Skip to content

Commit

Permalink
use __dict__ in check (#11012)
Browse files Browse the repository at this point in the history
* check is_hf_model in leaf module

Signed-off-by: Alexandros Koumparoulis <[email protected]>

* Apply isort and black reformatting

Signed-off-by: akoumpa <[email protected]>

* disable getattr alternative path

Signed-off-by: Alexandros Koumparoulis <[email protected]>

* fix

Signed-off-by: Alexandros Koumparoulis <[email protected]>

* undo;

Signed-off-by: Alexandros Koumparoulis <[email protected]>

---------

Signed-off-by: Alexandros Koumparoulis <[email protected]>
Signed-off-by: akoumpa <[email protected]>
Co-authored-by: akoumpa <[email protected]>
  • Loading branch information
2 people authored and yashaswikarnati committed Oct 24, 2024
1 parent 05273b4 commit f668f94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nemo/lightning/pytorch/strategies/megatron_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def __init__(
def connect(self, model: pl.LightningModule) -> None:
super().connect(model)

assert not hasattr(model, 'is_hf_model'), "Cannot use HfAutoModelForCausalLM with MegatronParallel"
assert not 'is_hf_model' in model.__dict__, "Cannot use HfAutoModelForCausalLM with MegatronParallel"

_maybe_mcore_config = _strategy_lib.set_model_parallel_attributes(model, self.parallelism)
if _maybe_mcore_config:
Expand Down

0 comments on commit f668f94

Please sign in to comment.