huggingface / nanotron

Minimalistic large language model 3D-parallelism training
Apache License 2.0
1.23k stars 122 forks source link

Update `src/nanotron/config/config.py` #33

Closed saforem2 closed 9 months ago

saforem2 commented 10 months ago

I was getting TypeError: Config.__init__() missing 1 required positional argument: profiler' when trying to run examples/config_tiny_llama.py.

Explicitly:

$ python3 examples/config_tiny_llama.py
Model has 16p4K parameters
Traceback (most recent call last):
  File "/lus/grand/projects/datascience/foremans/locations/polaris/projects/saforem2/nanotron/examples/config_tiny_llama.py", line 90, in <module>
    config = Config(
TypeError: Config.__init__() missing 1 required positional argument: 'profiler'
[1]    30778 exit 1     python3 examples/config_tiny_llama.py
2.78s user 5.53s system 231% cpu 3.590s total

the issue is coming from this line in the Config object in src/nanotron/config/config.py:

https://github.com/huggingface/nanotron/blob/main/src/nanotron/config/config.py#L334

Setting the Optional[ProfilerArgs] = None by default (as shown below) fixes this:

@dataclass
class Config:
    # [...]
    profiler: Optional[ProfilerArgs] = None
saforem2 commented 9 months ago

Fix #35