Revert MFSDP mixed precision config arguments.#2848
Conversation
Signed-off-by: Cory Ye <cye@nvidia.com>
📝 WalkthroughWalkthroughThis pull request removes mixed-precision configuration plumbing from the distributed model building and initialization pipeline. The Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/megatron/bridge/models/model_provider.py (1)
34-34:⚠️ Potential issue | 🟡 MinorRemove duplicate
Callableimport.
Callableis already imported at line 18. This duplicate import should be removed.Suggested fix
-from typing import Callable - import torch🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/megatron/bridge/models/model_provider.py` at line 34, Remove the duplicate import of Callable by deleting the redundant "from typing import Callable" line in model_provider.py so only the original Callable import (already present earlier in the file) remains; locate the duplicate import statement to remove it, leaving the earlier import at line 18 intact.
🧹 Nitpick comments (1)
src/megatron/bridge/models/common/unimodal.py (1)
15-20: Import ordering issue: standard library import after logger initialization.The
typingimport on line 20 should be grouped with other standard library imports at the top of the file, before the logger initialization. Per coding guidelines, imports should be organized in order: future imports, standard library, third-party, first-party, local folder imports.Suggested reordering
-import logging - - -logger = logging.getLogger(__name__) - -from typing import Any, Callable +import logging +from typing import Any, Callable + + +logger = logging.getLogger(__name__)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/megatron/bridge/models/common/unimodal.py` around lines 15 - 20, Move the standard-library import "from typing import Any, Callable" above the logger initialization and group it with other standard library imports at the top of the file so imports follow the required ordering; specifically, ensure the import occurs before the "logger = logging.getLogger(__name__)" line and keep the "logger" creation after all standard-library imports are declared.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/megatron/bridge/models/model_provider.py`:
- Line 34: Remove the duplicate import of Callable by deleting the redundant
"from typing import Callable" line in model_provider.py so only the original
Callable import (already present earlier in the file) remains; locate the
duplicate import statement to remove it, leaving the earlier import at line 18
intact.
---
Nitpick comments:
In `@src/megatron/bridge/models/common/unimodal.py`:
- Around line 15-20: Move the standard-library import "from typing import Any,
Callable" above the logger initialization and group it with other standard
library imports at the top of the file so imports follow the required ordering;
specifically, ensure the import occurs before the "logger =
logging.getLogger(__name__)" line and keep the "logger" creation after all
standard-library imports are declared.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 49915189-c5e5-4c3b-a8dc-2cdcc6435653
📒 Files selected for processing (6)
src/megatron/bridge/models/common/unimodal.pysrc/megatron/bridge/models/model_provider.pysrc/megatron/bridge/training/mixed_precision.pysrc/megatron/bridge/training/setup.pytests/unit_tests/models/common/test_unimodal.pytests/unit_tests/training/test_mixed_precision.py
💤 Files with no reviewable changes (4)
- src/megatron/bridge/training/mixed_precision.py
- tests/unit_tests/training/test_mixed_precision.py
- tests/unit_tests/models/common/test_unimodal.py
- src/megatron/bridge/training/setup.py
Signed-off-by: Cory Ye <cye@nvidia.com>
What does this PR do ?
Changelog
GitHub Actions CI
See the CI sectionin the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.
Before your PR is "Ready for review"
Pre checks:
If you haven't finished some of the above items you can still open "Draft" PR.
Additional Information
Summary by CodeRabbit