Skip to content

Commit

Permalink
Two trivial fixes (pytorch#611)
Browse files Browse the repository at this point in the history
I was reading the framework just out of interest and found two quick
fixes.

Especially, the rationale behind removing `strict=True` from `zip` is:
1. It's obvious that both iterables have the same length.
2. `strict=True` was introduced in `zip` in Python 3.10, but
`pyproject.toml` specifies `requires-python >= 3.8`.
  • Loading branch information
jaywonchung authored Oct 14, 2024
1 parent 7e93822 commit c134345
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion torchtitan/datasets/tokenizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def build_tokenizer(tokenizer_type: str, tokenizer_path: str) -> Tokenizer:
elif tokenizer_type == "tiktoken":
return TikTokenizer(tokenizer_path)
else:
raise ValueError(f"Unknown tokenizer type: {args.type}")
raise ValueError(f"Unknown tokenizer type: {tokenizer_type}")
1 change: 0 additions & 1 deletion torchtitan/parallelisms/parallel_dims.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def build_mesh(self, device_type):
for d, name in zip(
[self.pp, self.dp_replicate, self.dp_shard, self.tp],
["pp", "dp_replicate", "dp_shard", "tp"],
strict=True,
):
if d > 1:
dims.append(d)
Expand Down

0 comments on commit c134345

Please sign in to comment.