[trainer] remove --model_parallel (#9451)
* fix bad merge - dropped code * remove --model_parallel * Deal with TrainingArguments * Use a private attr and fix batch sizes * fix _n_gpu * add is_parallel helper wrapper * fix attribute * introduce a new attribute is_model_parallel * docs * docs * Put back init False and rearrange doc * Ignore non-init args in HFArgumentParser Co-authored-by: Sylvain Gugger <sylvain.gugger@gmail.com>
This commit is contained in:
@@ -53,6 +53,8 @@ class HfArgumentParser(ArgumentParser):
|
||||
|
||||
def _add_dataclass_arguments(self, dtype: DataClassType):
|
||||
for field in dataclasses.fields(dtype):
|
||||
if not field.init:
|
||||
continue
|
||||
field_name = f"--{field.name}"
|
||||
kwargs = field.metadata.copy()
|
||||
# field.metadata is not used at all by Data Classes,
|
||||
@@ -148,7 +150,7 @@ class HfArgumentParser(ArgumentParser):
|
||||
namespace, remaining_args = self.parse_known_args(args=args)
|
||||
outputs = []
|
||||
for dtype in self.dataclass_types:
|
||||
keys = {f.name for f in dataclasses.fields(dtype)}
|
||||
keys = {f.name for f in dataclasses.fields(dtype) if f.init}
|
||||
inputs = {k: v for k, v in vars(namespace).items() if k in keys}
|
||||
for k in keys:
|
||||
delattr(namespace, k)
|
||||
|
||||
Reference in New Issue
Block a user