Skip to content

Commit e3b3e86

Browse files
authored
CUDA tests: Skip running the program in test_sdpa_head_sizes in fbcode (#24592) (#24592)
Summary: In fbcode, `test_sdpa_head_sizes` now stops after exporting and lowering the model and does not run the program. It still runs end to end in OSS. The check is `is_fbcode()` from `executorch.export.utils`. Differential Revision: D129489023
1 parent 2737d8e commit e3b3e86

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎backends/cuda/tests/test_cuda_export.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,8 +1086,6 @@ def test_sdpa_single_kernel(self):
10861086
"loads through the Python runtime, which the ROCm build does not include",
10871087
)
10881088
def test_sdpa_head_sizes(self):
1089-
from executorch.runtime import Runtime
1090-
10911089
class Attention(torch.nn.Module):
10921090
def forward(self, *qkv):
10931091
return tuple(
@@ -1105,6 +1103,13 @@ def forward(self, *qkv):
11051103
)
11061104
model = Attention()
11071105
edge = self._export_to_cuda_with_lower(model, inputs)
1106+
from executorch.export.utils import is_fbcode
1107+
1108+
if is_fbcode():
1109+
# Running the program is skipped in fbcode.
1110+
return
1111+
from executorch.runtime import Runtime
1112+
11081113
with tempfile.TemporaryDirectory() as directory:
11091114
path = os.path.join(directory, "model.pte")
11101115
with open(path, "wb") as f:

0 commit comments

Comments
 (0)