Skip to content

Commit 2e86cce

Browse files
committed
revert change to recipe test
1 parent 2d32730 commit 2e86cce

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/recipes/test_lora_finetune_single_device.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ def test_loss_qlora(self, compile, dtype, tmpdir, monkeypatch):
119119
ckpt_dir = ckpt_path.parent
120120
log_file = gen_log_file_name(tmpdir)
121121

122+
# To workaround https://github.com/pytorch/torchtune/issues/676
123+
if compile:
124+
os.environ["TORCH_COMPILE_BACKEND"] = "aot_eager"
125+
122126
cmd = f"""
123127
tune run lora_finetune_single_device
124128
--config llama2/7B_qlora_single_device \
@@ -134,12 +138,6 @@ def test_loss_qlora(self, compile, dtype, tmpdir, monkeypatch):
134138
compile={compile} \
135139
""".split()
136140

137-
if compile:
138-
os.environ["TORCH_COMPILE_BACKEND"] = "aot_eager"
139-
if not torch_version_ge("2.5.0"):
140-
# Chunked cross entropy not support on 2.4
141-
cmd = cmd + ["loss=torch.nn.CrossEntropyLoss"]
142-
143141
model_config = MODEL_TEST_CONFIGS["llama2_qlora"]
144142

145143
cmd = cmd + self._get_test_config_overrides(dtype_str=dtype) + model_config

0 commit comments

Comments
 (0)