group: PyTorch
depends_on: 
  - image-build
steps:
- label: PyTorch Compilation Unit Tests
  device: h200_35gb
  key: pytorch-compilation-unit-tests
  timeout_in_minutes: 10
  source_file_dependencies:
    - vllm/__init__.py
    - vllm/_aiter_ops.py
    - vllm/_custom_ops.py
    - vllm/compilation/
    - vllm/config/
    - vllm/distributed/
    - vllm/engine/
    - vllm/env_override.py
    - vllm/envs.py
    - vllm/forward_context.py
    - vllm/inputs/
    - vllm/ir/
    - vllm/kernels/
    - vllm/logger.py
    - vllm/model_executor/
    - vllm/multimodal/
    - vllm/platforms/
    - vllm/plugins/
    - vllm/sampling_params.py
    - vllm/sequence.py
    - vllm/transformers_utils/
    - vllm/triton_utils/
    - vllm/utils/
    - vllm/v1/
    - tests/compile
  commands:
  # Run unit tests defined directly under compile/,
  # not including subdirectories, which are usually heavier
  # tests covered elsewhere.
  # Use `find` to launch multiple instances of pytest so that
  # they do not suffer from https://github.com/vllm-project/vllm/issues/28965
  # However, find does not normally propagate error codes, so we combine it with xargs
  # (using -0 for proper path handling)
  - "find compile/ -maxdepth 1 -name 'test_*.py' -print0 | xargs -0 -n1 -I{} pytest -s -v '{}'"

- label: PyTorch Compilation Unit Tests (H100)
  key: pytorch-compilation-unit-tests-h100
  timeout_in_minutes: 30
  device: h100
  num_devices: 1
  source_file_dependencies:
    - vllm/__init__.py
    - vllm/_aiter_ops.py
    - vllm/_custom_ops.py
    - vllm/compilation/
    - vllm/config/
    - vllm/distributed/
    - vllm/engine/
    - vllm/env_override.py
    - vllm/envs.py
    - vllm/forward_context.py
    - vllm/inputs/
    - vllm/ir/
    - vllm/kernels/
    - vllm/logger.py
    - vllm/model_executor/
    - vllm/multimodal/
    - vllm/platforms/
    - vllm/plugins/
    - vllm/sampling_params.py
    - vllm/sequence.py
    - vllm/transformers_utils/
    - vllm/triton_utils/
    - vllm/utils/
    - vllm/v1/
    - tests/compile/h100/
  commands:
  - "find compile/h100/ -name 'test_*.py' -print0 | xargs -0 -n1 -I{} pytest -s -v '{}'"

- label: PyTorch Compilation Passes Unit Tests
  key: pytorch-compilation-passes-unit-tests
  timeout_in_minutes: 20
  source_file_dependencies:
    - vllm/__init__.py
    - vllm/_aiter_ops.py
    - vllm/_custom_ops.py
    - vllm/compilation/
    - vllm/config/
    - vllm/distributed/
    - vllm/engine/
    - vllm/env_override.py
    - vllm/envs.py
    - vllm/forward_context.py
    - vllm/inputs/
    - vllm/ir/
    - vllm/kernels/
    - vllm/logger.py
    - vllm/model_executor/
    - vllm/multimodal/
    - vllm/platforms/
    - vllm/plugins/
    - vllm/sampling_params.py
    - vllm/sequence.py
    - vllm/transformers_utils/
    - vllm/triton_utils/
    - vllm/utils/
    - vllm/v1/
    - tests/compile/passes
  commands:
  - pytest -s -v compile/passes --ignore compile/passes/distributed

- label: PyTorch Fullgraph Smoke Test
  key: pytorch-fullgraph-smoke-test
  timeout_in_minutes: 35
  source_file_dependencies:
  - vllm/__init__.py
  - vllm/_aiter_ops.py
  - vllm/_custom_ops.py
  - vllm/compilation/
  - vllm/config/
  - vllm/distributed/
  - vllm/engine/
  - vllm/env_override.py
  - vllm/envs.py
  - vllm/forward_context.py
  - vllm/inputs/
  - vllm/ir/
  - vllm/kernels/
  - vllm/logger.py
  - vllm/model_executor/
  - vllm/multimodal/
  - vllm/platforms/
  - vllm/plugins/
  - vllm/sampling_params.py
  - vllm/sequence.py
  - vllm/transformers_utils/
  - vllm/triton_utils/
  - vllm/utils/
  - vllm/v1/
  - tests/compile
  commands:
  # Run smoke tests under fullgraph directory, except test_full_graph.py
  # as it is a heavy test that is covered in other steps.
  # Use `find` to launch multiple instances of pytest so that
  # they do not suffer from https://github.com/vllm-project/vllm/issues/28965
  - "find compile/fullgraph/ -name 'test_*.py' -not -name 'test_full_graph.py' -print0 | xargs -0 -n1 -I{} pytest -s -v '{}'"

- label: PyTorch Fullgraph
  key: pytorch-fullgraph
  timeout_in_minutes: 30
  device: h200_18gb
  source_file_dependencies:
  - vllm/__init__.py
  - vllm/_aiter_ops.py
  - vllm/_custom_ops.py
  - vllm/compilation/
  - vllm/config/
  - vllm/distributed/
  - vllm/engine/
  - vllm/env_override.py
  - vllm/envs.py
  - vllm/forward_context.py
  - vllm/inputs/
  - vllm/ir/
  - vllm/kernels/
  - vllm/logger.py
  - vllm/model_executor/
  - vllm/multimodal/
  - vllm/platforms/
  - vllm/plugins/
  - vllm/sampling_params.py
  - vllm/sequence.py
  - vllm/transformers_utils/
  - vllm/triton_utils/
  - vllm/utils/
  - vllm/v1/
  - tests/compile
  commands:
    # fp8 kv scales not supported on sm89, tested on Blackwell instead
  - pytest -v -s compile/fullgraph/test_full_graph.py -k 'not test_fp8_kv_scale_compile'

- label: Pytorch Nightly Dependency Override Check # 2min
  key: pytorch-nightly-dependency-override-check
  # if this test fails, it means the nightly torch version is not compatible with some
  # of the dependencies. Please check the error message and add the package to whitelist
  # in /vllm/tools/pre_commit/generate_nightly_torch_test.py
  device: h200_18gb
  soft_fail: true
  source_file_dependencies:
  - requirements/test/nightly-torch.txt
  commands:
  - bash standalone_tests/pytorch_nightly_dependency.sh
