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

fix bug in tl.store mask for kernel _to_fp8_row_major_t_and_non_t #1516

Merged
merged 59 commits into from
Jan 9, 2025

Conversation

danielvegamyhre
Copy link
Contributor

@danielvegamyhre danielvegamyhre commented Jan 7, 2025

Discovered this bug while prototyping torchtitan integration with float8nocompile in pytorch/torchtitan#778, the symptom was the grads went to NaN during training.

The issue was a mismatch between how output offsets for writing the transposed tensor are calculated, versus the offsets used in creating the output mask. Output offsets for writing were correct but the offsets used in the output mask were backwards accidentally.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@danielvegamyhre
Copy link
Contributor Author

danielvegamyhre commented Jan 7, 2025

Copy link

pytorch-bot bot commented Jan 7, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1516

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 96ee5ee with merge base f86fda9 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo
Copy link
Contributor

vkuzo commented Jan 8, 2025

looks like there is a gap in test coverage, is it doable to add a test to this PR which fails before the fix and passes after the fix?

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@danielvegamyhre
Copy link
Contributor Author

looks like there is a gap in test coverage, is it doable to add a test to this PR which fails before the fix and passes after the fix?

ah thanks for the reminder, just updated the e2e training test with a new test case with large inputs, which I've confirmed fails without this change and passes with this change.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@danielvegamyhre danielvegamyhre changed the base branch from gh/danielvegamyhre/16/head to main January 8, 2025 21:35
@danielvegamyhre danielvegamyhre merged commit 4738377 into main Jan 9, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants