Skip to content

Commit 2737d8e

Browse files
authored
CUDA tests: Skip running the program in test_fused_sdpa in fbcode (#24591) (#24591)
Summary: In fbcode, `test_fused_sdpa` now stops after its export and lowering checks and does not run the program. It still runs end to end in OSS. The check is `is_fbcode()` from `executorch.export.utils`. Reviewed By: shoumikhin Differential Revision: D129488831
1 parent ab27368 commit 2737d8e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎backends/cuda/tests/test_cuda_export.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,6 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
12121212
def test_fused_sdpa(self):
12131213
"""Decomposing attention on CUDA, as Torch-TensorRT does, gives fused
12141214
variants that the backend has no kernel for."""
1215-
from executorch.runtime import Runtime
12161215

12171216
class Attention(torch.nn.Module):
12181217
def forward(self, q, k, v, mask):
@@ -1263,6 +1262,13 @@ def forward(self, q, k, v, mask):
12631262
output = "\n".join(logs.output)
12641263
self.assertIn("Replaced 2 nodes with Triton kernels", output)
12651264
self.assertIn("Using split-K decode SDPA", output)
1265+
from executorch.export.utils import is_fbcode
1266+
1267+
if is_fbcode():
1268+
# Running the program is skipped in fbcode.
1269+
return
1270+
from executorch.runtime import Runtime
1271+
12661272
with tempfile.TemporaryDirectory() as directory:
12671273
path = os.path.join(directory, "model.pte")
12681274
with open(path, "wb") as f:

0 commit comments

Comments
 (0)