Fix broken import of nonexistent config module in fp8_fa3/setup.py - #4489
Open
Ashutosh0x wants to merge 1 commit into
Open
Fix broken import of nonexistent config module in fp8_fa3/setup.py#4489Ashutosh0x wants to merge 1 commit into
Ashutosh0x wants to merge 1 commit into
Conversation
setup_fp8_fa3() imported LowPrecisionAttentionConfig from torchao.prototype.attention.config, but this module does not exist -- it was removed during the API refactor that introduced apply_low_precision_attention() in api.py. The root cause is that setup_fp8_backend() in shared_utils/setup.py was updated to accept (model, flash_impl_name, hadamard) instead of the old (model, config, flash_impl_name, sdpa_fn) signature, but fp8_fa3/setup.py was not updated to match. This fix removes the stale LowPrecisionAttentionConfig import and updates setup_fp8_fa3() to use the current setup_fp8_backend() API. Fixes pytorch#4318 Test Plan: Verified the import resolves correctly by inspecting the module structure. This is a prototype module with no dedicated test suite. This change was authored with the assistance of an AI coding assistant.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4489
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setup_fp8_fa3()intorchao/prototype/attention/fp8_fa3/setup.pyimportsLowPrecisionAttentionConfigfromtorchao.prototype.attention.config, but this module does not exist. Importing or calling this function crashes immediately with aModuleNotFoundError.Root Cause
The
setup_fp8_backend()function inshared_utils/setup.pywas refactored to accept(model, flash_impl_name, hadamard)instead of the old(model, config, flash_impl_name, sdpa_fn)signature. Theapi.pyentry point was updated to use the new API, butfp8_fa3/setup.pywas not updated to match.Fix
LowPrecisionAttentionConfigfrom the nonexistentconfigmodulesetup_fp8_fa3()signature and body to match the currentsetup_fp8_backend()APIFixes #4318
Test Plan
Verified the import resolves correctly by inspecting the module structure. This is a prototype module without a dedicated test suite. The fix is a straightforward import/signature alignment.
This change was authored with the assistance of an AI coding assistant.