Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tensor cufile wip #264

Open
wants to merge 3 commits into
base: unstable
Choose a base branch
from

Conversation

weiyanlin117
Copy link
Contributor

No description provided.

@weiyanlin117 weiyanlin117 changed the title wip tensor cufile wip Oct 28, 2024
ccv_nnc_cuda_file_entry file_entry = ccv_nnc_get_file_entry(filename);
// Open the file using cuFile
tensor->data.u8 = (uint8_t*)cuDirectFileReadAsync(CCV_TENSOR_GET_DEVICE_ID(params.type), size, filename, offset, cuSharedFileIOStream(), file_entry.file_handle, file_entry.file_descr);
cuSharedStreamSync();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sync here 10/10 pass test

ccv_nnc_tensor_t* a_result = ccv_nnc_tensor_new(0, GPU_TENSOR_NHWC(000, 32F, 5), 0);
ccv_nnc_cmd_exec(CMD_ADD_FORWARD(0.5, 0.2), ccv_nnc_no_hint, 0, TENSOR_LIST(tensor_a, one_gpu), TENSOR_LIST(a_result), 0);
float a[] = {1 * 0.5 + 0.2, 2 * 0.5 + 0.2, 3 * 0.5 + 0.2, 4 * 0.5 + 0.2, 5 * 0.5 + 0.2};
ccv_nnc_tensor_t* tensor_b = ccv_nnc_tensor_new_from_file(GPU_TENSOR_NHWC(000, 32F, 4), "tensor.bin", (4096 * 4 * 4), 0);
cuSharedStreamSync();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sync here 4/10 pass test...

for (int i = 0; i < MAX_FILES; i++) {
if (!file_map[i].is_used) {
memset(&file_map[i], 0, sizeof(ccv_nnc_cuda_file_entry));
strncpy(file_map[i].filename, filename, sizeof(file_map[i].filename) - 1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strlen(filename) + 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants