{# vllm-omni customized version
   Based on: https://github.com/vllm-project/ci-infra/blob/main/buildkite/test-template-amd.j2
   Last synced: 2025-12-15
   Modifications: Removed unused CUDA/NVIDIA logic, keeping only AMD tests
#}
{% set docker_image_amd = "rocm/vllm-omni:$BUILDKITE_COMMIT" %}
{% set default_working_dir = "/app/vllm-omni" %}

  - group: "AMD Tests"
    depends_on: ~
    steps:
      - label: "AMD: :docker: build image"
        depends_on: ~
        soft_fail: false
        commands:
          - "docker build -f docker/Dockerfile.rocm -t {{ docker_image_amd }} --target test --build-arg ARG_PYTORCH_ROCM_ARCH=gfx942 --progress plain ."
          - "docker push {{ docker_image_amd }}"
        key: "amd-build"
        env:
          DOCKER_BUILDKIT: "1"
        retry:
          automatic:
            - exit_status: -1  # Agent was lost
              limit: 2
            - exit_status: -10  # Agent was lost
              limit: 2
            - exit_status: 128  # Git connectivity issues
              limit: 2
            - exit_status: 1  # Machine occasionally fail
              limit: 1
        agents:
          queue: amd-cpu

    {% for step in steps %}
    {% if step.mirror_hardwares and mirror_hw in step.mirror_hardwares %}
      - label: "{{ step.agent_pool }}: {{ step.label }}"
        depends_on: amd-build
        agents:
          {% if step.agent_pool %}
          queue: amd_{{ step.agent_pool }}
          {% else %}
          queue: amd_mi325_1
          {% endif %}
{% set cmd_body = (step.command or (step.commands | join("\n"))) | trim %}
{% set indented_cmd = cmd_body | replace("\n", "\n            ") %}
        command: bash .buildkite/scripts/hardware_ci/run-amd-test.sh
        env:
          DOCKER_BUILDKIT: "1"
          TEST_COMMAND: |-
            (command rocm-smi || true) && cd {{ (step.working_dir or default_working_dir) | safe }}
{% if "mi250" in step.agent_pool %}
            python3 -m pip uninstall -y amd-aiter
{% endif %}
            {{ indented_cmd | safe }}
        priority: 100
        {% if step.timeout_in_minutes %}
        timeout_in_minutes: {{ step.timeout_in_minutes }}
        {% endif %}
        {% if step.grade and step.grade == "Blocking" %}
        soft_fail: false
        {% else %}
        soft_fail: true
        {% endif%}
    {% endif %}
    {% endfor %}
