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

Add option to enable fp8_shard_intermediate_activation #1215

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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
3 changes: 3 additions & 0 deletions thunder/benchmarks/benchmark_litgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def __init__(
use_torchao_fp8_linear: bool = False,
use_torchao_fp8_allgather: bool = False,
use_torchao_fp8_precompute_scale_for_fsdp: bool = False,
fp8_shard_intermediate_activation: bool = False,
):
seed = 1337
torch.manual_seed(seed)
Expand Down Expand Up @@ -271,6 +272,7 @@ def __init__(
self.is_thunder_as_torchcompile_backend = False
self.dump_thunder_traces = dump_thunder_traces
self.dump_memory_snapshot = dump_memory_snapshot
self.fp8_shard_intermediate_activation = fp8_shard_intermediate_activation

if use_torchao_fp8_linear:

Expand Down Expand Up @@ -588,6 +590,7 @@ def setup_compile(self, model):
# so we are using the lower level torch._dynamo.optimize function
model = torch._dynamo.optimize(backend=backend)(model)
else:
jit_options["fp8_shard_intermediate_activation"] = self.fp8_shard_intermediate_activation
model = thunder.jit(model, executors=executors, **jit_options)

elif self.compile != "eager":
Expand Down
Loading