CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
87 lines
2.2 KiB
Python
87 lines
2.2 KiB
Python
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
"""Shared pytest fixtures for the descriptor codegen test suite."""
|
|
|
|
import pytest
|
|
from pathlib import Path
|
|
|
|
from codegen.config_loader import load_config
|
|
from codegen.generator import DescriptorGenerator
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def configs_dir():
|
|
"""Path to the configs/ directory."""
|
|
return Path(__file__).parent.parent / "configs"
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def config_path(configs_dir):
|
|
"""Factory fixture: returns path to a named config file."""
|
|
|
|
def _config_path(name: str) -> Path:
|
|
return configs_dir / name
|
|
|
|
return _config_path
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def load_test_config(config_path):
|
|
"""Factory fixture: loads a named YAML config into OperationConfig."""
|
|
|
|
def _load(name: str):
|
|
return load_config(config_path(name))
|
|
|
|
return _load
|
|
|
|
|
|
@pytest.fixture
|
|
def convolution_fwd_config(load_test_config):
|
|
"""Reference config -- most complete, has all frontend fields + enum_def."""
|
|
return load_test_config("convolution_fwd.yaml")
|
|
|
|
|
|
@pytest.fixture
|
|
def pointwise_config(load_test_config):
|
|
"""Config with optional tensors, optional scalars, mode field with enum_def."""
|
|
return load_test_config("pointwise.yaml")
|
|
|
|
|
|
@pytest.fixture
|
|
def batchnorm_config(load_test_config):
|
|
"""Config with tensor arrays, many optional tensors, array return type."""
|
|
return load_test_config("batchnorm.yaml")
|
|
|
|
|
|
@pytest.fixture
|
|
def matmul_config(load_test_config):
|
|
"""Minimal config -- no data fields, no mode fields."""
|
|
return load_test_config("matmul.yaml")
|
|
|
|
|
|
@pytest.fixture
|
|
def sdpa_config(load_test_config):
|
|
"""Complex config -- many tensors, multiple mode fields, both shared."""
|
|
return load_test_config("sdpa.yaml")
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def template_dir():
|
|
"""Path to the templates/ directory."""
|
|
return Path(__file__).parent.parent / "templates"
|
|
|
|
|
|
@pytest.fixture
|
|
def generator(template_dir):
|
|
"""DescriptorGenerator instance configured with the real template dir."""
|
|
return DescriptorGenerator(template_dir)
|
|
|
|
|
|
@pytest.fixture
|
|
def all_config_names():
|
|
"""List of all YAML config filenames."""
|
|
from tests.helpers import ALL_CONFIG_NAMES
|
|
|
|
return ALL_CONFIG_NAMES
|