This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TORCHDYNAMO_INLINE_INBUILT_NN_MODULES=0 TORCH_LOGS=recompiles python benchmarks/dynamo/torchbench.py --accuracy --no-translation-validation --inference --bfloat16 --backend eager --disable-cudagraphs --device cuda --only=hf_T5_generate | |
loading model: 0it [00:29, ?it/s] | |
cuda eval hf_T5_generate | |
V0617 16:32:34.360000 140419876123776 torch/_dynamo/guards.py:2619] [8/1] [__recompiles] Recompiling function forward in /home/anijain/local/miniconda3/envs/pytorch2/lib/python3.11/site-packages/transformers/models/t5/modeling_t5.py:1639 | |
V0617 16:32:34.360000 140419876123776 torch/_dynamo/guards.py:2619] [8/1] [__recompiles] triggered by the following guard failure(s): | |
V0617 16:32:34.360000 140419876123776 torch/_dynamo/guards.py:2619] [8/1] [__recompiles] - ___check_obj_id(L['past_key_values'], 8825760) | |
V0617 16:32:38.606000 140419876123776 torch/_dynamo/guards.py:2619] [10/1] [__recompiles] Recompiling function _update_model_kwargs_for_generation in /home/anijain/local/miniconda3/envs/pytorch2/lib/python3.11/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@torch.compile(backend="eager") | |
def fn(x, y, d): | |
return x * y * d["foo"] * d["bar"] | |
V0410 15:48:57.778000 140318524949632 torch/_dynamo/guards.py:1785] [0/0] [__guards] GUARDS: | |
V0410 15:48:57.778000 140318524949632 torch/_dynamo/guards.py:1803] [0/0] [__guards] ___check_type_id(L['d'], 8833952) # return x * y * d["foo"] * d["bar"] # examples/ord_dicts.py:24 in fn | |
V0410 15:48:57.778000 140318524949632 torch/_dynamo/guards.py:1803] [0/0] [__guards] len(L['d']) == 2 # return x * y * d["foo"] * d["bar"] # examples/ord_dicts.py:24 in fn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from collections import OrderedDict | |
torch._dynamo.config.error_on_recompile = True | |
d = { | |
30: 4, | |
25: 2, | |
20: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
torch._dynamo.config.guard_nn_modules = True | |
class SubMod(torch.nn.Module): | |
def __init__(self): | |
super().__init__() | |
self.linear = torch.nn.Linear(10, 10) | |
def forward(self, x): | |
return self.linear(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# minified2.py | |
import torch | |
from torch import nn | |
import os | |
from torch import distributed as dist | |
from torch.nn.parallel import DistributedDataParallel as DDP | |
import torch._dynamo | |
# torch._dynamo.config.optimize_ddp = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch.utils.checkpoint import checkpoint | |
class MyModule(torch.nn.Module): | |
def __init__(self): | |
super().__init__() | |
self.linear = torch.nn.Linear(10, 10) | |
def _forward_helper(self, x): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torchrec | |
from torchrec.sparse.jagged_tensor import _maybe_compute_kjt_to_jt_dict | |
from typing import List, Optional | |
torch._logging.set_logs(**torch._logging.DEFAULT_LOGGING) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
******* loading model args.model='t5' | |
--> World Size = 1 | |
--> Device_count = 2 | |
--> running with these defaults train_config(seed=2023, verbose=True, total_steps_to_run=8, warmup_steps=5, use_orig_params=True, limit_all_gathers=True, use_ddp=False, ddp_bucket_size=25, ddp_use_gradient_view=False, hf_t5_checkpointing=False, print_memory_summary=False, print_training_loss_data=False, num_epochs=4, model_weights_bf16=False, use_mixed_precision=True, use_low_precision_gradient_policy=False, use_tf32=True, optimizer='AdamW', ap_use_kahan_summation=False, sharding_strategy=<ShardingStrategy.FULL_SHARD: 1>, print_sharding_plan=False, run_profiler=False, profile_folder='fsdp/profile_tracing', log_every=1, num_workers_dataloader=2, batch_size_training=16, fsdp_activation_checkpointing=True, use_fused_attention=False, use_parallel_attention=False, run_validation=True, memory_report=True, nccl_debug_handler=True, distributed_debug=True, use_non_recursive_wrapping=False, use_synthetic_data=False, use_deferred_init=False, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
class Foo(torch.nn.Module): | |
def __init__(self): | |
super().__init__() | |
self.register_buffer("iterations", torch.tensor(0)) | |
def forward(self, x): | |
self.iterations.add_(1) | |
return x * self.iterations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
class MockModule(torch.nn.Module): | |
def __init__(self): | |
super().__init__() | |
self.a = torch.tensor(0) | |
self.b = torch.tensor(0) | |
self.register_buffer("iterations", torch.tensor(0)) |
NewerOlder