Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use max auto-tune no cuda graphs for max perf #176

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configs/10B/H100.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ wandb_resume = false
[train]
micro_bs = 1
ac_ckpt = true
torch_compile_mode = "max-autotune-no-cudagraphs"

[optim]
sched_type = "wsd-sqrt"
Expand Down
1 change: 1 addition & 0 deletions configs/10B/H100_cooldown.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ wandb_resume = false
[train]
micro_bs = 1
ac_ckpt = true
torch_compile_mode = "max-autotune-no-cudagraphs"

[optim]
sched_type = "wsd-sqrt"
Expand Down
1 change: 1 addition & 0 deletions configs/10B/H100_simple.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project = "debug_10B_zero_band"
[train]
micro_bs = 1
ac_ckpt = true
torch_compile_mode = "max-autotune-no-cudagraphs"

[optim]
sched_type = "wsd-sqrt"
Expand Down
1 change: 1 addition & 0 deletions configs/150M_short/H100.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type_model = "llama2"
[train]
micro_bs = 64 # change this base on the gpu
reshard_after_forward = true
torch_compile_mode = "max-autotune-no-cudagraphs"

[optim]
batch_size = 512
Expand Down
3 changes: 2 additions & 1 deletion src/zeroband/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class MemoryProfilerConfig(BaseConfig):
class TrainConfig(BaseConfig):
micro_bs: int
torch_compile: bool = True
torch_compile_mode: Literal["max-autotune-no-cudagraphs"] | None = None
ac_ckpt: bool | int = False
reshard_after_forward: bool = True # old shard grad op True mean full shard

Expand Down Expand Up @@ -246,7 +247,7 @@ def train(config: Config):

if config.train.torch_compile:
# we need to compile AFTER creating the CKPT manager, DON'T ASK ME WHY
model = torch.compile(model)
model = torch.compile(model, mode=config.train.torch_compile_mode)
logger.debug("model compiled")

if config.ckpt.resume is not None:
Expand Down
Loading