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

Can someone explain how the memory is allocated for alpha, beta and log_probs2? #94

Open
ronggong opened this issue Dec 7, 2021 · 0 comments

Comments

@ronggong
Copy link

ronggong commented Dec 7, 2021

alphas = reinterpret_cast<ProbT *>(static_cast<char *>(workspace) + bytes_used);

Hi,

I am looking for an explanation of L103 to L110. Afaiu, workspace is the expected memory size to allocate for all batch, see below code:

*size_bytes = per_minibatch_bytes * minibatch;

and byte_used is the allocated memory size. I could not understand, why in the code, we allocate workspace + byte_used memory size for alpha, beta and log_probs2? The reason, from my understanding, workspace is already the memory size for the entire batch, so the allocation here is redundant?

Cheers,

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

No branches or pull requests

1 participant