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

[cuda] Fix memory alignment bug in pre-allocated memory allocator. #3096

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

AmesingFlank
Copy link
Collaborator

@AmesingFlank AmesingFlank commented Oct 6, 2021

Related issue = #2847

This will fix test_sfg.

@netlify
Copy link

netlify bot commented Oct 6, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: 0815900

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/615e26b9694e0d0007e486d3

Copy link
Collaborator

@qiao-bo qiao-bo left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks!

Was the sfg test failed due to long execution time? Apart from the fact that a misaligned address is returned here, the amount of allocation remains correct. I expect this only affects performance in tests...

Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

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

Wow, thanks for catching this! (Clearly, I wrote this bug, so my apologies...)

It's amazing that a serious bug like this can live for this long!

@yuanming-hu yuanming-hu merged commit 637c426 into taichi-dev:master Oct 7, 2021
@yuanming-hu
Copy link
Member

Was the sfg test failed due to long execution time? Apart from the fact that a misaligned address is returned here, the amount of allocation remains correct. I expect this only affects performance in tests...

Sounds like an interesting discussion! For misaligned memory accesses on CPUs you may get a bus error, and on GPUs you get a CUDA memory misalignment error. Not sure what the error message was.

@AmesingFlank
Copy link
Collaborator Author

AmesingFlank commented Oct 7, 2021

Wow, thanks for catching this! (Clearly, I wrote this bug, so my apologies...)

It's amazing that a serious bug like this can live for this long!

The error that I observed was a CUDA misalignment error.

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.

3 participants