From 1ca05a105a9f5367d6fe88e18b22997d0bb4e53d Mon Sep 17 00:00:00 2001 From: Max Podkorytov <4273004+tenpercent@users.noreply.github.com> Date: Wed, 22 Apr 2026 18:06:19 +0000 Subject: [PATCH] [rocm-libraries] ROCm/rocm-libraries#6434 (commit 87aae5c) Fix ck4inductor conv instance parsing for NumGroupsToMerge parameter (#6434) ## Summary - Add `num_groups_to_merge` field to `CKGroupedConvFwdOp` dataclass to match the new (#4273) `NumGroupsToMerge` template parameter added to `DeviceGroupedConvFwdMultipleABD_Xdl_CShuffle_V3` - Enable inductor tests by default in Jenkins CI ## Test plan - [x] Built wheel without patch: `test_gen_conv_instances` fails with `TypeError: takes from 47 to 50 positional arguments but 51 were given` - [x] Built wheel with patch: `test_gen_conv_instances` passes --- Jenkinsfile | 12 +++------- python/ck4inductor/grouped_conv_fwd/op.py | 1 + script/run_inductor_tests.sh | 28 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 9 deletions(-) create mode 100755 script/run_inductor_tests.sh diff --git a/Jenkinsfile b/Jenkinsfile index f75ed63f22..eda530511b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -915,13 +915,7 @@ def Build_CK(Map conf=[:]){ cmake_build(conf) if ( params.RUN_INDUCTOR_TESTS && arch == "gfx90a" ){ echo "Run inductor codegen tests" - sh """ - python3 -m venv ${env.WORKSPACE}/projects/composablekernel - . ${env.WORKSPACE}/projects/composablekernel/bin/activate - python3 -m pip install pytest build setuptools setuptools_scm - python3 -m pip install . - python3 -m pytest python/test/test_gen_instances.py - """ + sh "projects/composablekernel/script/run_inductor_tests.sh" } // run performance tests, stash the logs, results will be processed on the master node dir("projects/composablekernel/script"){ @@ -1338,8 +1332,8 @@ pipeline { description: "Generate a detailed time trace (default: OFF)") booleanParam( name: "RUN_INDUCTOR_TESTS", - defaultValue: false, - description: "Run inductor codegen tests (default: OFF)") + defaultValue: true, + description: "Run inductor codegen tests (default: ON)") booleanParam( name: "RUN_CODEGEN_TESTS", defaultValue: true, diff --git a/python/ck4inductor/grouped_conv_fwd/op.py b/python/ck4inductor/grouped_conv_fwd/op.py index 8301f0d07f..576c36f66d 100644 --- a/python/ck4inductor/grouped_conv_fwd/op.py +++ b/python/ck4inductor/grouped_conv_fwd/op.py @@ -67,6 +67,7 @@ class CKGroupedConvFwdOp: b_compute_dtype: Optional[str] = None direct_load: Optional[bool] = None + num_groups_to_merge: Optional[int] = None def name(self): # cpp alias for template instance diff --git a/script/run_inductor_tests.sh b/script/run_inductor_tests.sh new file mode 100755 index 0000000000..6fed9d2dce --- /dev/null +++ b/script/run_inductor_tests.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Run inductor codegen tests +# This script is called from Jenkinsfile to reduce pipeline bytecode size + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +CK_DIR="$(dirname "$SCRIPT_DIR")" +VENV_DIR="${WORKSPACE:-/tmp}/ck-inductor-venv" +export UV_CACHE_DIR="${WORKSPACE:-/tmp}/.uv-cache" + +cd "$CK_DIR" + +echo "Setting up Python virtual environment at $VENV_DIR" +python3 -m venv "$VENV_DIR" +. "$VENV_DIR/bin/activate" + +echo "Installing uv for faster package installation" +pip install uv + +echo "Installing test dependencies" +uv pip install pytest build setuptools setuptools_scm + +echo "Installing ck4inductor package" +uv pip install . + +echo "Running inductor codegen tests" +python3 -m pytest python/test/test_gen_instances.py -v