[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ACC45MKWYRHQ9CAD1Q254Q":3,"skill-same:01M6ACC45MKWYRHQ9CAD1Q254Q":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":45,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":17,"updatedAt":48,"install":49,"resources":62},"01M6ACC45MKWYRHQ9CAD1Q254Q","tir-test","TVM TIRx 测试运行","Run TVM's in-tree TIRx tests and tirx-kernels import and correctness checks.","运行 TVM 内置的 TIRx 测试，以及 tirx-kernels 的导入与正确性检查。","apache\u002Ftvm","apache","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47359?v=4","01M6AC83E6K4FDKK7HZ8WNMQKE","The Apache Software Foundation","01M6ACBZAJXV6B7T950208GGVD",13899,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fapache\u002Ftvm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftir-test\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障","SCENARIO","使用场景",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师","PROFESSION","适用职业",[31,32,33,34],"test","tir test","run","tvm","2026-11-10 10:12:30",false,"---\nname: tir-test\ndescription: Run TVM's in-tree TIRx tests and tirx-kernels import and correctness checks.\n---\n\nRun the compiler suite in `3rdparty\u002Ftvm-tirx\u002Ftests\u002Fpython\u002Ftirx\u002F`, using the `tvm_tirx` package\nin `3rdparty\u002Ftvm-tirx\u002Fpython\u002F`, together with the downstream correctness test in\n`tests\u002Fpython\u002Ftirx\u002Ftest_tirx_kernels_registry_correctness.py`.\n\nBoth tirx-kernels import gates and its correctness coverage are enabled by\ndefault. Use `TIR_TEST_WITH_KERNELS=0` only for an explicitly requested\ncompiler-only run, and report that reduced coverage.\n\n## Steps\n\nRun all commands below in the same Bash shell from the TVM repository root.\n\n1. Point Python at this worktree and select every Blackwell GPU.\n   `TIR_TEST_GPUS` may explicitly provide physical GPU IDs, and\n   `TIR_TEST_NUM_GPUS` may optionally cap the automatically selected count. Otherwise,\n   selection uses all Blackwell GPUs, ordered by least memory in use.\n   ```bash\n   export TIR_TEST_TVM_ROOT=\"$(pwd -P)\"\n   export TIR_TEST_NUM_GPUS=\"${TIR_TEST_NUM_GPUS:-}\"\n   export TIR_TEST_XDIST_WORKERS=\"${TIR_TEST_XDIST_WORKERS:-16}\"\n   export TIR_TEST_WITH_KERNELS=\"${TIR_TEST_WITH_KERNELS:-1}\"\n\n   [[ -d \"$TIR_TEST_TVM_ROOT\u002F3rdparty\u002Ftvm-tirx\u002Fpython\u002Ftvm_tirx\" &&\n      -d \"$TIR_TEST_TVM_ROOT\u002F3rdparty\u002Ftvm-tirx\u002Ftests\u002Fpython\u002Ftirx\" ]] || {\n     echo \"run from the TVM repository root containing 3rdparty\u002Ftvm-tirx\u002F\" >&2\n     exit 2\n   }\n   [[ \"$TIR_TEST_WITH_KERNELS\" == 0 || \"$TIR_TEST_WITH_KERNELS\" == 1 ]] || {\n     echo \"TIR_TEST_WITH_KERNELS must be 0 or 1\" >&2\n     exit 2\n   }\n\n   [[ -z \"$TIR_TEST_NUM_GPUS\" || \"$TIR_TEST_NUM_GPUS\" =~ ^[1-9][0-9]*$ ]] || {\n     echo \"TIR_TEST_NUM_GPUS must be empty or a positive integer\" >&2\n     exit 2\n   }\n   [[ \"$TIR_TEST_XDIST_WORKERS\" =~ ^[1-9][0-9]*$ ]] || {\n     echo \"TIR_TEST_XDIST_WORKERS must be a positive integer\" >&2\n     exit 2\n   }\n\n   if [[ -n \"${TIR_TEST_GPUS:-}\" ]]; then\n     IFS=, read -r -a TIR_TEST_SELECTED_GPUS \u003C\u003C\u003C \"${TIR_TEST_GPUS\u002F\u002F \u002F}\"\n   else\n     mapfile -t TIR_TEST_SELECTED_GPUS \u003C \u003C(\n       nvidia-smi \\\n         --query-gpu=index,memory.used,compute_cap \\\n         --format=csv,noheader,nounits \\\n       | awk -F, '\n           {\n             for (i = 1; i \u003C= 3; ++i) {\n               gsub(\u002F^[[:space:]]+|[[:space:]]+$\u002F, \"\", $i)\n             }\n             if (($3 + 0) >= 10) {\n               print $1, $2\n             }\n           }' \\\n       | sort -k2,2n -k1,1n \\\n       | awk '{print $1}'\n     )\n     if [[ -n \"$TIR_TEST_NUM_GPUS\" ]] && \\\n        (( ${#TIR_TEST_SELECTED_GPUS[@]} > TIR_TEST_NUM_GPUS )); then\n       TIR_TEST_SELECTED_GPUS=(\n         \"${TIR_TEST_SELECTED_GPUS[@]:0:TIR_TEST_NUM_GPUS}\"\n       )\n     fi\n   fi\n\n   (( ${#TIR_TEST_SELECTED_GPUS[@]} > 0 )) || {\n     echo \"no CUDA compute capability >= 10 GPU is available\" >&2\n     exit 1\n   }\n   for gpu in \"${TIR_TEST_SELECTED_GPUS[@]}\"; do\n     [[ \"$gpu\" =~ ^[0-9]+$ ]] || {\n       echo \"invalid physical GPU ID: $gpu\" >&2\n       exit 2\n     }\n   done\n   if [[ -z \"${TIR_TEST_GPUS:-}\" && -n \"$TIR_TEST_NUM_GPUS\" ]] && \\\n      (( ${#TIR_TEST_SELECTED_GPUS[@]} \u003C TIR_TEST_NUM_GPUS )); then\n     echo \"warning: requested $TIR_TEST_NUM_GPUS GPUs, using ${#TIR_TEST_SELECTED_GPUS[@]}\"\n   fi\n\n   export CUDA_VISIBLE_DEVICES\n   CUDA_VISIBLE_DEVICES=\"$(IFS=,; printf '%s' \"${TIR_TEST_SELECTED_GPUS[*]}\")\"\n   # Preserve reference packages and other paths supplied by branch-shell.\n   export PYTHONPATH=\"${TIR_TEST_TVM_ROOT}\u002F.local\u002Fpython:${TIR_TEST_TVM_ROOT}\u002F3rdparty\u002Ftvm-tirx\u002Fpython:${TIR_TEST_TVM_ROOT}\u002Fpython:${PYTHONPATH:-}\"\n   export TVM_LIBRARY_PATH=\"${TIR_TEST_TVM_ROOT}\u002Fbuild\u002Flib\"\n   export TVM_TIRX_LIBRARY_PATH=\"${TIR_TEST_TVM_ROOT}\u002Fbuild\u002Flib\"\n\n   PYTHON_BIN=\"${PYTHON_BIN:-$(command -v python || true)}\"\n   [[ -n \"$PYTHON_BIN\" && -x \"$PYTHON_BIN\" ]] || {\n     echo \"set PYTHON_BIN to the test environment's Python executable\" >&2\n     exit 1\n   }\n   export PATH=\"$(dirname \"$PYTHON_BIN\"):$PATH\"\n   \"$PYTHON_BIN\" - \u003C\u003C'PY'\n   import os\n   from pathlib import Path\n\n   import pytest\n   import torch\n   import tvm_ffi\n   import tvm_tirx\n   import xdist\n   from tvm_tirx.base import _LOADED_LIBS, _RUNTIME_ONLY\n\n   root = Path(os.environ[\"TIR_TEST_TVM_ROOT\"])\n   assert Path(tvm_tirx.__file__).resolve().is_relative_to(root \u002F \"3rdparty\u002Ftvm-tirx\u002Fpython\"), (\n       f\"imported another TIRx worktree: {tvm_tirx.__file__}\"\n   )\n   assert not _RUNTIME_ONLY, \"build the TIRx compiler before running its tests\"\n   for name, library in _LOADED_LIBS.items():\n       assert Path(library._name).resolve().is_relative_to(root \u002F \"build\u002Flib\"), (\n           f\"loaded another worktree's {name}: {library._name}\"\n       )\n   print(f\"tvm_tirx: {tvm_tirx.__file__}\")\n   print(f\"tvm_ffi: {tvm_ffi.__file__}\")\n   PY\n   if [[ $? -ne 0 ]]; then\n     echo \"PYTHON_BIN must provide pytest, xdist, torch and this worktree's TIRx build\" >&2\n     exit 1\n   fi\n   if ! command -v ninja >\u002Fdev\u002Fnull; then\n     NINJA_BIN_DIR=\"$(\"$PYTHON_BIN\" -c 'import ninja; print(ninja.BIN_DIR)' 2>\u002Fdev\u002Fnull || true)\"\n     if [[ -n \"$NINJA_BIN_DIR\" && -x \"$NINJA_BIN_DIR\u002Fninja\" ]]; then\n       export PATH=\"$NINJA_BIN_DIR:$PATH\"\n     fi\n   fi\n   command -v ninja >\u002Fdev\u002Fnull || {\n     echo \"ninja is required by kernel JIT setup but is not on PATH\" >&2\n     exit 1\n   }\n\n   echo \"selected physical GPUs: $CUDA_VISIBLE_DEVICES\"\n   for logical_id in \"${!TIR_TEST_SELECTED_GPUS[@]}\"; do\n     echo \"  cuda:$logical_id -> physical GPU ${TIR_TEST_SELECTED_GPUS[$logical_id]}\"\n   done\n   ```\n\n   Automatic selection uses every Blackwell device. Set\n   `TIR_TEST_NUM_GPUS=4` to cap the count or `TIR_TEST_GPUS=3,4,5,6` to override\n   selection with exact physical IDs.\n\n   Use dependencies compatible with `3rdparty\u002Ftvm-tirx\u002Fpyproject.toml`. A non-editable FFI\n   installation in `.local\u002Fpython\u002F` takes priority over the inherited environment.\n   If native libraries are missing or stale, build this worktree with the same\n   `PYTHONPATH` before testing.\n\n2. Run downstream import gates and select the full test coverage:\n   ```bash\n   TIR_TEST_PATHS=(3rdparty\u002Ftvm-tirx\u002Ftests\u002Fpython\u002Ftirx\u002F)\n   if [[ \"$TIR_TEST_WITH_KERNELS\" == 1 ]]; then\n     TIR_TEST_KERNELS_ROOT=\"${TIR_TEST_KERNELS_ROOT:-$(dirname \"$TIR_TEST_TVM_ROOT\")\u002Ftirx-kernels}\"\n     [[ -d \"$TIR_TEST_KERNELS_ROOT\u002Ftirx_kernels\" ]] || {\n       echo \"set TIR_TEST_KERNELS_ROOT to the tirx-kernels repository\" >&2\n       exit 2\n     }\n     export PYTHONPATH=\"${TIR_TEST_KERNELS_ROOT}:${PYTHONPATH:-}\"\n     \"$PYTHON_BIN\" -m tirx_kernels.bench_suite --check-imports || exit 1\n     \"$PYTHON_BIN\" -m tirx_kernels.registry --strict || exit 1\n     TIR_TEST_PATHS+=(tests\u002Fpython\u002Ftirx\u002Ftest_tirx_kernels_registry_correctness.py)\n     export TIRX_KERNEL_TEST_MIN_FREE_GB=\"${TIRX_KERNEL_TEST_MIN_FREE_GB:-0}\"\n   else\n     echo \"compiler-only run: tirx-kernels import and correctness checks disabled\"\n   fi\n   ```\n\n3. Run the selected test suites with xdist parallelism and save the full log:\n   ```bash\n   export TIR_TEST_LOG=\"${TIR_TEST_LOG:-\u002Ftmp\u002Ftir-test-$(date +%Y%m%d-%H%M%S).log}\"\n   set -o pipefail\n   \"$PYTHON_BIN\" -m pytest \"${TIR_TEST_PATHS[@]}\" -n \"$TIR_TEST_XDIST_WORKERS\" 2>&1 | tee \"$TIR_TEST_LOG\"\n   ```\n\n   `3rdparty\u002Ftvm-tirx\u002Ftests\u002Fpython\u002Ftirx\u002Fconftest.py` uses `tvm_tirx.testing._pytest` to assign\n   each xdist worker's PyTorch current device round-robin across the visible\n   GPUs. Tests that explicitly use `tvm_tirx.cuda(0)` still run on the first\n   selected physical GPU.\n\n   Registry correctness tests take a per-device lock to serialize large workloads\n   on each GPU. MegaMoE remains skipped because it requires its dedicated\n   multi-process scheduler.\n\n4. Report results: selected physical GPUs, elapsed time, total passed, failed,\n   skipped, and errors, plus the full log path. Report both downstream gates as\n   passed, failed, or explicitly disabled; disabled integration checks are not\n   passes.\n\n## Failure triage rules\n\n**CRITICAL: Never pipe test output to `tail` or `grep` when diagnosing failures.\nAlways capture and read full logs.**\n\nClassify every failure into one of these categories:\n\n- **A - Environment\u002Fimport error**: Module not found, missing dependency,\n  collection error. Check the source and native-library paths, FFI dependency,\n  and old `tvm` versus `tvm_tirx` namespaces before assigning a cause.\n- **B - Real kernel correctness regression**: Assertion failures (`cosine_sim`,\n  numerical diff), `CUDA: unspecified launch failure`, or wrong results. These\n  MUST be investigated and fixed if caused by current changes.\n- **C - Secondary xdist crash**: `KeyError: \u003CWorkerController gwXX>` after a\n  worker abort. The KeyError itself is noise; find the underlying cause (usually\n  category B in another worker).\n\nNever dismiss a failure as pre-existing without evidence. If a test fails:\n\n1. Check whether the test touches code you changed.\n2. If unclear, verify on the parent commit before claiming it is pre-existing.\n3. Fix every failure caused by current changes; do not defer it.\n","Run the compiler suite in `3rdparty\u002Ftvm-tirx\u002Ftests\u002Fpython\u002Ftirx\u002F`, using the `tvm_tirx` package\nin `3rdparty\u002Ftvm-tirx\u002Fpython\u002F`, together with the downstream correctness test in\n`tests\u002Fpython\u002Ftirx\u002Ftest_tirx_kernels_registry_correctness.py`.\n\nBoth tirx-kernels import gates and its correctness coverage are enabled by\ndefault. Use `TIR_TEST_WITH_KERNELS=0` only for an explicitly requested\ncompiler-only run, and report that reduced coverage.\n\n## Steps\n\nRun all commands below in the same Bash shell from the TVM repository root.\n\n1. Point Python at this worktree and select every Blackwell GPU.\n   `TIR_TEST_GPUS` may explicitly provide physical GPU IDs, and\n   `TIR_TEST_NUM_GPUS` may optionally cap the automatically selected count. Otherwise,\n   selection uses all Blackwell GPUs, ordered by least memory in use.\n   ```bash\n   export TIR_TEST_TVM_ROOT=\"$(pwd -P)\"\n   export TIR_TEST_NUM_GPUS=\"${TIR_TEST_NUM_GPUS:-}\"\n   export TIR_TEST_XDIST_WORKERS=\"${TIR_TEST_XDIST_WORKERS:-16}\"\n   export TIR_TEST_WITH_KERNELS=\"${TIR_TEST_WITH_KERNELS:-1}\"\n\n   [[ -d \"$TIR_TEST_TVM_ROOT\u002F3rdparty\u002Ftvm-tirx\u002Fpython\u002Ftvm_tirx\" &&\n      -d \"$TIR_TEST_TVM_ROOT\u002F3rdparty\u002Ftvm-tirx\u002Ftests\u002Fpython\u002Ftirx\" ]] || {\n     echo \"run from the TVM repository root containing 3rdparty\u002Ftvm-tirx\u002F\" >&2\n     exit 2\n   }\n   [[ \"$TIR_TEST_WITH_KERNELS\" == 0 || \"$TIR_TEST_WITH_KERNELS\" == 1 ]] || {\n     echo \"TIR_TEST_WITH_KERNELS must be 0 or 1\" >&2\n     exit 2\n   }\n\n   [[ -z \"$TIR_TEST_NUM_GPUS\" || \"$TIR_TEST_NUM_GPUS\" =~ ^[1-9][0-9]*$ ]] || {\n     echo \"TIR_TEST_NUM_GPUS must be empty or a positive integer\" >&2\n     exit 2\n   }\n   [[ \"$TIR_TEST_XDIST_WORKERS\" =~ ^[1-9][0-9]*$ ]] || {\n     echo \"TIR_TEST_XDIST_WORKERS must be a positive integer\" >&2\n     exit 2\n   }\n\n   if [[ -n \"${TIR_TEST_GPUS:-}\" ]]; then\n     IFS=, read -r -a TIR_TEST_SELECTED_GPUS \u003C\u003C\u003C \"${TIR_TEST_GPUS\u002F\u002F \u002F}\"\n   else\n     mapfile -t TIR_TEST_SELECTED_GPUS \u003C \u003C(\n       nvidia-smi \\\n         --query-gpu=index,memory.used,compute_cap \\\n         --format=csv,noheader,nounits \\\n       | awk -F, '\n           {\n             for (i = 1; i \u003C= 3; ++i) {\n               gsub(\u002F^[[:space:]]+|[[:space:]]+$\u002F, \"\", $i)\n             }\n             if (($3 + 0) >= 10) {\n               print $1, $2\n             }\n           }' \\\n       | sort -k2,2n -k1,1n \\\n       | awk '{print $1}'\n     )\n     if [[ -n \"$TIR_TEST_NUM_GPUS\" ]] && \\\n        (( ${#TIR_TEST_SELECTED_GPUS[@]} > TIR_TEST_NUM_GPUS )); then\n       TIR_TEST_SELECTED_GPUS=(\n         \"${TIR_TEST_SELECTED_GPUS[@]:0:TIR_TEST_NUM_GPUS}\"\n       )\n     fi\n   fi\n\n   (( ${#TIR_TEST_SELECTED_GPUS[@]} > 0 )) || {\n     echo \"no CUDA compute capability >= 10 GPU is available\" >&2\n     exit 1\n   }\n   for gpu in \"${TIR_TEST_SELECTED_GPUS[@]}\"; do\n     [[ \"$gpu\" =~ ^[0-9]+$ ]] || {\n       echo \"invalid physical GPU ID: $gpu\" >&2\n       exit 2\n     }\n   done\n   if [[ -z \"${TIR_TEST_GPUS:-}\" && -n \"$TIR_TEST_NUM_GPUS\" ]] && \\\n      (( ${#TIR_TEST_SELECTED_GPUS[@]} \u003C TIR_TEST_NUM_GPUS )); then\n     echo \"warning: requested $TIR_TEST_NUM_GPUS GPUs, using ${#TIR_TEST_SELECTED_GPUS[@]}\"\n   fi\n\n   export CUDA_VISIBLE_DEVICES\n   CUDA_VISIBLE_DEVICES=\"$(IFS=,; printf '%s' \"${TIR_TEST_SELECTED_GPUS[*]}\")\"\n   # Preserve reference packages and other paths supplied by branch-shell.\n   export PYTHONPATH=\"${TIR_TEST_TVM_ROOT}\u002F.local\u002Fpython:${TIR_TEST_TVM_ROOT}\u002F3rdparty\u002Ftvm-tirx\u002Fpython:${TIR_TEST_TVM_ROOT}\u002Fpython:${PYTHONPATH:-}\"\n   export TVM_LIBRARY_PATH=\"${TIR_TEST_TVM_ROOT}\u002Fbuild\u002Flib\"\n   export TVM_TIRX_LIBRARY_PATH=\"${TIR_TEST_TVM_ROOT}\u002Fbuild\u002Flib\"\n\n   PYTHON_BIN=\"${PYTHON_BIN:-$(command -v python || true)}\"\n   [[ -n \"$PYTHON_BIN\" && -x \"$PYTHON_BIN\" ]] || {\n     echo \"set PYTHON_BIN to the test environment's Python executable\" >&2\n     exit 1\n   }\n   export PATH=\"$(dirname \"$PYTHON_BIN\"):$PATH\"\n   \"$PYTHON_BIN\" - \u003C\u003C'PY'\n   import os\n   from pathlib import Path\n\n   import pytest\n   import torch\n   import tvm_ffi\n   import tvm_tirx\n   import xdist\n   from tvm_tirx.base import _LOADED_LIBS, _RUNTIME_ONLY\n\n   root = Path(os.environ[\"TIR_TEST_TVM_ROOT\"])\n   assert Path(tvm_tirx.__file__).resolve().is_relative_to(root \u002F \"3rdparty\u002Ftvm-tirx\u002Fpython\"), (\n       f\"imported another TIRx worktree: {tvm_tirx.__file__}\"\n   )\n   assert not _RUNTIME_ONLY, \"build the TIRx compiler before running its tests\"\n   for name, library in _LOADED_LIBS.items():\n       assert Path(library._name).resolve().is_relative_to(root \u002F \"build\u002Flib\"), (\n           f\"loaded another worktree's {name}: {library._name}\"\n       )\n   print(f\"tvm_tirx: {tvm_tirx.__file__}\")\n   print(f\"tvm_ffi: {tvm_ffi.__file__}\")\n   PY\n   if [[ $? -ne 0 ]]; then\n     echo \"PYTHON_BIN must provide pytest, xdist, torch and this worktree's TIRx build\" >&2\n     exit 1\n   fi\n   if ! command -v ninja >\u002Fdev\u002Fnull; then\n     NINJA_BIN_DIR=\"$(\"$PYTHON_BIN\" -c 'import ninja; print(ninja.BIN_DIR)' 2>\u002Fdev\u002Fnull || true)\"\n     if [[ -n \"$NINJA_BIN_DIR\" && -x \"$NINJA_BIN_DIR\u002Fninja\" ]]; then\n       export PATH=\"$NINJA_BIN_DIR:$PATH\"\n     fi\n   fi\n   command -v ninja >\u002Fdev\u002Fnull || {\n     echo \"ninja is required by kernel JIT setup but is not on PATH\" >&2\n     exit 1\n   }\n\n   echo \"selected physical GPUs: $CUDA_VISIBLE_DEVICES\"\n   for logical_id in \"${!TIR_TEST_SELECTED_GPUS[@]}\"; do\n     echo \"  cuda:$logical_id -> physical GPU ${TIR_TEST_SELECTED_GPUS[$logical_id]}\"\n   done\n   ```\n\n   Automatic selection uses every Blackwell device. Set\n   `TIR_TEST_NUM_GPUS=4` to cap the count or `TIR_TEST_GPUS=3,4,5,6` to override\n   selection with exact physical IDs.\n\n   Use dependencies compatible with `3rdparty\u002Ftvm-tirx\u002Fpyproject.toml`. A non-editable FFI\n   installation in `.local\u002Fpython\u002F` takes priority over the inherited environment.\n   If native libraries are missing or stale, build this worktree with the same\n   `PYTHONPATH` before testing.\n\n2. Run downstream import gates and select the full test coverage:\n   ```bash\n   TIR_TEST_PATHS=(3rdparty\u002Ftvm-tirx\u002Ftests\u002Fpython\u002Ftirx\u002F)\n   if [[ \"$TIR_TEST_WITH_KERNELS\" == 1 ]]; then\n     TIR_TEST_KERNELS_ROOT=\"${TIR_TEST_KERNELS_ROOT:-$(dirname \"$TIR_TEST_TVM_ROOT\")\u002Ftirx-kernels}\"\n     [[ -d \"$TIR_TEST_KERNELS_ROOT\u002Ftirx_kernels\" ]] || {\n       echo \"set TIR_TEST_KERNELS_ROOT to the tirx-kernels repository\" >&2\n       exit 2\n     }\n     export PYTHONPATH=\"${TIR_TEST_KERNELS_ROOT}:${PYTHONPATH:-}\"\n     \"$PYTHON_BIN\" -m tirx_kernels.bench_suite --check-imports || exit 1\n     \"$PYTHON_BIN\" -m tirx_kernels.registry --strict || exit 1\n     TIR_TEST_PATHS+=(tests\u002Fpython\u002Ftirx\u002Ftest_tirx_kernels_registry_correctness.py)\n     export TIRX_KERNEL_TEST_MIN_FREE_GB=\"${TIRX_KERNEL_TEST_MIN_FREE_GB:-0}\"\n   else\n     echo \"compiler-only run: tirx-kernels import and correctness checks disabled\"\n   fi\n   ```\n\n3. Run the selected test suites with xdist parallelism and save the full log:\n   ```bash\n   export TIR_TEST_LOG=\"${TIR_TEST_LOG:-\u002Ftmp\u002Ftir-test-$(date +%Y%m%d-%H%M%S).log}\"\n   set -o pipefail\n   \"$PYTHON_BIN\" -m pytest \"${TIR_TEST_PATHS[@]}\" -n \"$TIR_TEST_XDIST_WORKERS\" 2>&1 | tee \"$TIR_TEST_LOG\"\n   ```\n\n   `3rdparty\u002Ftvm-tirx\u002Ftests\u002Fpython\u002Ftirx\u002Fconftest.py` uses `tvm_tirx.testing._pytest` to assign\n   each xdist worker's PyTorch current device round-robin across the visible\n   GPUs. Tests that explicitly use `tvm_tirx.cuda(0)` still run on the first\n   selected physical GPU.\n\n   Registry correctness tests take a per-device lock to serialize large workloads\n   on each GPU. MegaMoE remains skipped because it requires its dedicated\n   multi-process scheduler.\n\n4. Report results: selected physical GPUs, elapsed time, total passed, failed,\n   skipped, and errors, plus the full log path. Report both downstream gates as\n   passed, failed, or explicitly disabled; disabled integration checks are not\n   passes.\n\n## Failure triage rules\n\n**CRITICAL: Never pipe test output to `tail` or `grep` when diagnosing failures.\nAlways capture and read full logs.**\n\nClassify every failure into one of these categories:\n\n- **A - Environment\u002Fimport error**: Module not found, missing dependency,\n  collection error. Check the source and native-library paths, FFI dependency,\n  and old `tvm` versus `tvm_tirx` namespaces before assigning a cause.\n- **B - Real kernel correctness regression**: Assertion failures (`cosine_sim`,\n  numerical diff), `CUDA: unspecified launch failure`, or wrong results. These\n  MUST be investigated and fixed if caused by current changes.\n- **C - Secondary xdist crash**: `KeyError: \u003CWorkerController gwXX>` after a\n  worker abort. The KeyError itself is noise; find the underlying cause (usually\n  category B in another worker).\n\nNever dismiss a failure as pre-existing without evidence. If a test fails:\n\n1. Check whether the test touches code you changed.\n2. If unclear, verify on the parent commit before claiming it is pre-existing.\n3. Fix every failure caused by current changes; do not defer it.\n",{"name":5,"description":7},"main","70ec7d5bf20326ef301ee3f06eb6aed51760331d",".agents\u002Fskills\u002Ftir-test",4044,"https:\u002F\u002Fgithub.com\u002Fapache\u002Ftvm","https:\u002F\u002Ftvm.apache.org\u002F","https:\u002F\u002Fgithub.com\u002Fapache","https:\u002F\u002Fwww.apache.org\u002F","2026-11-13 09:16:04",{"source":9,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add apache\u002Ftvm --skill tir-test",{"tool":55,"command":56},"bunx","bunx skills add apache\u002Ftvm --skill tir-test",{"tool":58,"command":59},"pnpm","pnpm dlx skills add apache\u002Ftvm --skill tir-test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fapache\u002Ftvm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftir-test\u002FSKILL.md",true,[],[64,79],{"skillNo":65,"name":66,"nameZh":67,"description":68,"descriptionZh":69,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":70,"categories":71,"keywords":76,"publishedAt":35},"01M6ACC72NKZDVWVS0C101ZM2J","tirx-ptx-dialect","TVM PTX 方言指令表维护","Register, extend, or audit instructions in the table-driven T.ptx dialect (python\u002Ftvm\u002Fbackend\u002Fcuda\u002Fptx\u002Ftable.py), and move the table to a newer PTX ISA version. Use when adding a PTX instruction or qualifier, widening an operand domain, fixing a ptxas certification failure, or checking the table's comments against the PTX ISA document.","在表驱动的 T.ptx 方言（python\u002Ftvm\u002Fbackend\u002Fcuda\u002Fptx\u002Ftable.py）中注册、扩展或审查指令，并将该表迁移到更新的 PTX ISA 版本。适用于添加 PTX 指令或限定符、扩展操作数取值范围、修复 ptxas 认证失败，或对照 PTX ISA 文档检查表中的注释。","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftvm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftirx-ptx-dialect\u002FSKILL.md",[72,73],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":74,"categoryName":75,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BT7QVANT4709358VEJK53E","代码实现",[77,78,34],"tirx ptx dialect","python",{"skillNo":80,"name":81,"nameZh":82,"description":17,"descriptionZh":83,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":84,"categories":85,"keywords":90,"publishedAt":35},"01M6ACC1F929HWF8S5Y1PCTQVC","tir-build","TVM TIR 构建","","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftvm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftir-build\u002FSKILL.md",[86,87],{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":88,"categoryName":89,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理",[91],"tir build"]