Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding hotfix and unit tests uncovering issue with WandbLogger in https://nvidia.slack.com/archives/C074Z808N05/p1733418209959769 ## DETAILS An interesting observation: this genuinely appears to be a wandb bug, since it can only be captured once it’s converted into a Lightning hook during training. Only one out of 4 new unit tests fails when probably all of them should The error is only uncovered only after `NeMoLogger` setup as n https://github.com/NVIDIA/NeMo/blob/bb895bc4b28ba99d707cb907c4496297a2a7b533/nemo/collections/llm/api.py#L852C22-L856C6 and after `plt.Trainer` setup at the start of the training in https://github.com/Lightning-AI/pytorch-lightning/blob/de7c28ae865b5c9fd3ff21debebb994605f7f420/src/lightning/pytorch/trainer/trainer.py#L944 which is executed in https://github.com/Lightning-AI/pytorch-lightning/blob/caa9e1e59436913e365bf52eeb2b07e3bf67efac/src/lightning/pytorch/trainer/call.py#L94C1-L97C34 ## TESTING ON BROKEN MAIN BRANCH ``` self = Settings(allow_offline_artifacts=True, allow_val_change=False, anonymous=None, api_key=None, azure_account_url_to_acce...andb', sync_symlink_latest='/workspace/bionemo2/wandb/latest-run', timespec='', wandb_dir='/workspace/bionemo2/wandb/') name = 'root_dir', value = PosixPath('/tmp/pytest-of-dorotat/pytest-20/test_nemo_logger_initilized0/unit-test-loggers') def __setattr__(self, name: str, value: Any) -> None: if name in self.__class_vars__: raise AttributeError( f'{name!r} is a ClassVar of `{self.__class__.__name__}` and cannot be set on an instance. ' f'If you want to set a value on the class, use `{self.__class__.__name__}.{name} = value`.' ) elif not _fields.is_valid_field_name(name): if self.__pydantic_private__ is None or name not in self.__private_attributes__: _object_setattr(self, name, value) else: attribute = self.__private_attributes__[name] if hasattr(attribute, '__set__'): attribute.__set__(self, value) # type: ignore else: self.__pydantic_private__[name] = value return self._check_frozen(name, value) attr = getattr(self.__class__, name, None) if isinstance(attr, property): attr.__set__(self, value) elif self.model_config.get('validate_assignment', None): > self.__pydantic_validator__.validate_assignment(self, name, value) E pydantic_core._pydantic_core.ValidationError: 1 validation error for Settings E root_dir E Input should be a valid string [type=string_type, input_value=PosixPath('/tmp/pytest-of...zed0/unit-test-loggers'), input_type=PosixPath] E For further information visit https://errors.pydantic.dev/2.9/v/string_type /usr/local/lib/python3.10/dist-packages/pydantic/main.py:881: ValidationError ``` <img width="1362" alt="image" src="https://github.com/user-attachments/assets/cb1f645d-4c1d-4baa-9e5e-474fbb04aa9b"> <img width="1154" alt="image" src="https://github.com/user-attachments/assets/0cb54012-8d99-44d8-a556-9f6cbf5cd97b"> --------- Co-authored-by: Steven Kothen-Hill <[email protected]>
- Loading branch information