Commit Graph
111 Commits
Author SHA1 Message Date
wangsike 950852f678 ci: add NPU canary plugin to batch runner for poisoner diagnostics
Merged-batch workers share one pytest process across cases. When an
aclnn operator fails fatally (e.g. MirrorPad/TopKV2 tiling failure on
boundary inputs), the NPU task queue enters CAN_EXIT and all subsequent
operators become silent no-ops returning garbage — the poisoning case
itself often still reports PASSED.

Add a pytest plugin that probes process health (torch.ones(4).sum()
verifiable computation) around every case:
- teardown probe failure -> the case that just finished is recorded as
  suspected poisoner (nodeid printed to batch log + JSONL marker in
  report_dir)
- setup probe failure -> recorded as victim (poisoned before it started)

Diagnostics only, never aborts the batch. Mirrors the proven probe from
run_npu_test_shard.py::_check_npu_poisoned. Disable with NPU_CANARY=0.
2026-10-09 15:53:44 +08:00
wangsike ba57a425c0 ci: add merged-batch test executor for manual build-and-test pipeline
Add run_npu_test_shard_batch.py: one pytest.main() call per same-file
batch (max 100 cases) with a batch-level junit XML, so module collection
(test_meta.py instantiates 34k+ items) happens once per batch instead of
once per case (~10x faster on collection-bound shards).

Simplified on purpose for the whitelisted manual pipeline: no NPU
poisoner checks, no worker restarts, no per-case XML recovery. A crashed
or hung batch (idle watchdog: no output for timeout+120s) marks all its
cases as error; per-case pytest-timeout (signal method) marks a single
slow case failed and keeps the rest of the batch.

Wire it through _test.yml/_test-category.yml with a batch_execution
input (default false) so PR-gated and nightly flows keep the per-case
runner untouched; pytorch_ci_trigger_manual.yml opts in with true.
2026-10-08 18:48:19 +08:00
yuaiming 9a123dd654 ci: add skip_issue field to skipped cases record 2026-09-30 10:44:02 +08:00
wangsike 1b12001ae5 ci: remove sigsegv-repro workflow and stress harness
The test_foreach worker SIGSEGV forensics work is done: the harness
(sigsegv_stress.py) and its push-triggered repro workflow served the
root-cause investigation of issue 5231 and are no longer needed.
run_npu_test_shard.py is kept untouched — it is shared by the real CI
test workflows, and the harness only invoked its generic --worker
mode. The test_foreach SIGSEGV entries in the PR skip list also stay:
they protect PR CI from the known crashes.
2026-09-30 09:32:03 +08:00
thickhair 32f14362c4 ci: drive the coverage case set from a case-level whitelist
- carry the picked case list in coverage_test_whitelist.yml (case_whitelist, 67336 nodeids)
  next to the file-to-category mapping
- collect_all_cases.py: add --case-whitelist to restrict the collected files and nodeids
- add the coverage-only _pytorch_coverage_collect.yml and use it from _pytorch_coverage.yml,
  leaving the shared _test-collect.yml untouched
- lower the regular shard threshold to 10000 for more parallel coverage jobs
- rebuild the job summary from the artifact and move it after the publish step
2026-09-29 20:20:28 +08:00
thickhair c10daa070f ci: publish coverage releases as a single archive and flatten the snapshot to covstub/torch
- unpack the source snapshot flat as covstub/torch + covstub/test
- pack a release into releases/<run_id>/release.tar.gz and reap only older releases
- backfill missing coverage data from an archive-style previous release
- build the test-case map only when the flatten step produced data
- drop the per-run coverage artifact upload
2026-09-29 11:34:44 +08:00
thickhair b79355ed5b ci: give every coverage case a private data file
All shard workers shared one default .coverage in pytorch/test (both the plugin
and the COVERAGE_PROCESS_START auto-start instances), so concurrent writes left
schema-less files and the per-case copy failed (no such table: other_db.file /
file, 137 times in run 35965803503), silently dropping coverage for cases like
nn/test_lazy_modules.py. The plugin now measures into a per-session private
file, the rc is passed as COVERAGE_PLUGIN_RCFILE so nothing else auto-starts,
and grouping marks a test file FAILED when its passed cases left no data
2026-09-24 16:24:01 +08:00
thickhair b6936433d0 ci: drop redundant comments from the coverage pipeline 2026-09-23 14:17:09 +08:00
thickhair 00eecb600d ci: name coverage groups after test files so the merge is a plain union
Shard products now use the merged layout directly: <test file>/covdata/{coverage,FAILED}
and logs/<test file>.log, with no flat names, so the merge job only unions the shard
directories (per-file logs append, since one test file can span two shards). Unmatched
data is kept in _unmapped/ instead of zz_unmapped__<shard>/, and the merge job timeout
drops from 120 to 30 minutes now that it no longer downloads artifacts.
2026-09-23 11:51:21 +08:00
thickhair cde3d39ef6 ci: fix per-case coverage naming and map installed sources for merge 2026-09-22 21:12:47 +08:00
thickhair 3d07220cb8 ci: collect per-case coverage via pytest plugin and merge it per test file 2026-09-22 19:46:00 +08:00
thickhair 46ec3a7470 ci: shard coverage per category like the pr trigger pipeline
Reuse _test-collect.yml (whitelist + hw_classification + skip list) to
collect and shard the PR trigger case set, run one coverage job per
(category, shard) through run_npu_test_shard.py with per-process
coverage data, and merge every shard in a final job that uploads the
full torch@latest bundle and only overwrites OBS latest on full runs.
2026-09-22 18:23:47 +08:00
thickhair ce9c28a360 ci: align coverage case set with pr trigger and upload full artifacts
Run the coverage script with hw_classification=ACCELERATOR and the
pr_skip_list.jsonl deselect list so the executed cases match the PR
trigger pipeline (receive-trigger.yml), and treat pytest exit 5
(nothing selected) as no cases instead of a failure. Upload the whole
torch@latest directory as the GitHub artifact so the run can be
verified from the run page; this can be narrowed again later.
2026-09-22 17:01:54 +08:00
thickhair cb8045bbb7 ci: fix python -u placement and strip test/ path prefix in coverage script 2026-09-22 15:55:24 +08:00
yuaiming d3623d1875 ci: replace run_npu_test_shard.py with nightly_run_npu_test_shard.py 2026-09-22 14:50:13 +08:00
thickhair d76262ec33 feat(ci): 实现覆盖率工作流的缓存构建与原子输出 2026-09-22 11:09:08 +08:00
thickhair 432ba383b6 refactor(ci): 内联环境变量 2026-09-21 20:15:01 +08:00
thickhair a05cd86736 feat(ci): 新增 PyTorch 源码覆盖率定时流水线 2026-09-21 19:23:56 +08:00
yuaiming 61e421e50b ci: fix x86_64 torch wheel path (flat, no torch/ subdir) 2026-09-21 19:05:34 +08:00
yuaiming 2684599d86 ci: switch x86_64 torch wheel to download-r2 archive 2026-09-21 17:53:19 +08:00
yuaiming a09face716 ci: support x86_64 torch wheel install on a5 pipeline 2026-09-21 16:35:40 +08:00
yuaiming 17e1496228 ci: add a5 torch-npu daily verification pipeline 2026-09-21 15:11:10 +08:00
wangsike 5c91696aee ci: add summary job comparing case collection results in collect-only pipeline 2026-09-21 08:56:53 +08:00
wangsike b32bb01068 ci: halve collect parallelism to 16 and raise per-file timeout to 300s 2026-09-20 18:50:21 +08:00
wangsike 95741d0749 ci: print full nodeid in progress log lines 2026-09-20 15:45:47 +08:00
wangsike 4af67baee3 ci: fix gdb rc=1 misclassification and switch E3 to attach_gdb_batch
Run 35221589981 results: gdb_aslr_batch completed all 9 cases in 704/704
runs with zero crashes — ASLR-off was NOT the suppression factor; the
gdb environment itself shifts the heap layout. 695 runs were
misclassified abnormal:1 because gdb -batch exits 1 when the
post-exit -ex commands (info registers etc.) error on an exited
inferior; classify gdb runs with all cases completed and no crash
marker as ok.

E3 now falls back to attach_gdb_batch (worker starts unmodified, gdb
ptrace-attaches after case 1 — zero memory relocation): default modes
are attach_gdb_batch,valgrind_batch,worker_batch. Baseline channels
reconfirmed in this run: valgrind 4/4 error signature (same 2 below-SP
read contexts), worker_batch 3 crashes at the known signatures
(cos done=2, expm1 done=8).
2026-09-18 14:16:25 +08:00
wangsike 5540be23b4 ci: implement E1-E4 root-cause verification experiment modes in sigsegv-repro
Implements the verification-plan experiment matrix on top of the
existing harness (instrument refactor: use_valgrind/use_gdb bools ->
single instrument parameter):

- gdb_aslr_batch (E3 primary): gdb -batch with 'set disable-randomization
  off' - gdb's ASLR-off default suppressed the crash entirely (run
  35171553271: 708 runs 0 crashes); also captures info registers,
  x/4i $pc, thread apply all bt full and info proc mappings at the
  crash point
- attach_gdb_batch (E3 fallback): worker starts unmodified, gdb
  ptrace-attaches after the first case completes (zero memory
  relocation); crash marker + native stacks parsed from gdb.log which
  is gzip-archived for every run
- valgrind_origins_batch (E2 dataflow): memcheck with
  --undef-value-errors=yes --track-origins=yes to trace where the
  stale below-SP stack values flow into their uses
- helgrind_batch (E4 race hypothesis): valgrind --tool=helgrind with
  error-exitcode 98, classified as hg_error, logs archived under
  helgrind-logs/
- E1 ablation presets documented in the workflow (baseline / no-clamp /
  clamp-only / triple / no-clone / reversed subsets)
- default modes: gdb_aslr_batch,valgrind_batch,worker_batch on the
  9-case baseline window; summary gains hg_error column
2026-09-17 15:18:25 +08:00
wangsike 1ee1041117 ci: add gdb_batch native-stack mode and fix valgrind log archiving in sigsegv-repro
Root-cause instrumentation round 2, closing the forensics gaps found in
run 35049336150:

Harness:
- gdb_batch mode: wraps each worker in 'gdb -batch' (run + 'thread apply
  all bt full' + 'info threads'); on signal death gdb stops and prints
  native stacks for every thread into worker.log — no core dumps needed
  (the runner platform ignores --privileged, core_pattern stays
  unwritable). 'Program received signal X' in the log is classified as
  crash:X regardless of gdb's own exit code
- valgrind: valgrind.log is now gzip-archived to valgrind-logs/ for
  EVERY run (run 35049336150 completed 100 cases cleanly then hung at
  exit and was SIGKILLed, losing the logs); workers that finish all
  cases but hang past a 180s grace are terminated and classified
  ok_killed
- summary gains ok_killed column

Workflow:
- default modes now gdb_batch,worker_batch,valgrind_batch (native stack
  first)
- default REPRO_CASE_SUBSET=10857-10865: the 9-case minimal crash window
  (clamp_min .. expm1, all 4 crashes in run 35049336150 happened within
  these cases) for faster iterations and sequence bisection
- valgrind-logs/ added to the forensics artifact upload
2026-09-17 09:39:11 +08:00
wangsike 3ce33f493a ci: add root-cause debugging aids to sigsegv-repro harness and workflow
Harness (sigsegv_stress.py):
- new valgrind_batch mode: replays the batch under valgrind memcheck
  (--undef-value-errors=no, --error-exitcode=99) so the corrupting heap
  write is caught with a full native stack; MALLOC_*/PYTHONMALLOC debug
  vars are stripped from valgrind workers; valgrind.log is archived in
  crash forensics; rc=99 classified as vg_error and counted as a finding
- new --case-subset: explicit case_idx list (ranges allowed, order
  preserved) overriding --case-range for minimal-sequence bisection and
  permuted replays
- kept cores now stay under repro-run/cores/kept (runner-local) instead
  of crash-forensics/ so artifact uploads stay small; gdb_bt_*.txt still
  carries the backtraces

Workflow (sigsegv-repro.yml):
- container runs privileged so core_pattern is writable (crash cores)
- job env: ASCEND_GLOBAL_LOG_LEVEL=1 (INFO, last aclnn ops in plog),
  MALLOC_CHECK_=3 + MALLOC_PERTURB_=165 + PYTHONMALLOC=debug (abort at
  the corrupting malloc/free, perturbed freed memory, pymalloc checks)
- install gdb libc6-dbg valgrind (best-effort)
- REPRO_CASE_SUBSET plumbed through; default modes now
  worker_batch,valgrind_batch,pair_case
2026-09-16 10:40:20 +08:00
wangsike b5d46d74f4 ci: add SIGSEGV repro and forensics harness for test_foreach worker crashes
Add sigsegv_stress.py (replays the crashed CI case batch through
run_npu_test_shard.py --worker with identical batch_input/env/device in
three modes: worker_batch, pair_case suspect/control, subprocess_per_case)
and sigsegv-repro.yml (workflow_dispatch driver that installs the source
run's wheels/source/cases, enables core dumps, and captures gdb
backtraces / faulthandler / CANN plog / attribution on every worker death
by signal).

Targets the intermittent test_foreach worker SIGSEGV where the runner
blames the first unreported case (foreach_clone run 34837447197,
foreach_floor run 34841388595, foreach_trunc nightly 34829305129);
suspect: preceding clamp_min case exercising aclnnForeachMaximumList.
2026-09-15 08:40:22 +08:00
wangsike b71d11ae4f ci: remove always-unknown run name field from Feishu failure notification 2026-09-08 22:26:11 +08:00
y30037164 ec805a07a1 modify device to do full-test 2026-09-03 16:52:37 +08:00
wangsike 0ee6f2260b ci: add Feishu webhook notification for test failure report
- Add send_feishu_notification.py: push plain-text failure summary to
  Feishu group bot when failed/error/timeout cases exist in the
  consolidated report (silent exit otherwise)
- _test-report.yml: add notification step (always(), continue-on-error)
- _nightly_test.yml/_test.yml: pass secrets to report job so
  FEISHU_WEBHOOK_URL is available
- nightly.yml: trigger on notification script changes
2026-09-02 17:29:21 +08:00
y30037164 43f3406a66 add pipeline for cpu 2026-09-02 16:32:52 +08:00
wangsike 565375cac2 ci: remove nightly-v3 and nightly-new workflow chains
The v2 (nightly-new) and v3 (nightly-v3) experimental nightly chains
are no longer needed. Remove both entry workflows, their sub-workflows
(_build/_test/-collect/-exec/-report/-compare v2+v3), and their
exclusive support files (.github/scripts/v2, .github/scripts/v3,
nightly_v2_test_whitelist.yml). The active nightly.yml chain and its
scripts/config are unaffected.
2026-09-02 14:11:56 +08:00
wangsike 61f47c983d ci: recover lost worker results from batch results file and junit xml
Worker stdout JSON lines can be corrupted by native test output and
silently dropped by the reader, causing false errors. Before marking
missing cases as errors on normal worker exit, reconcile against
on-disk evidence: batch_results_{batch_id}.json first, then per-case
junit xml files. Only cases with no evidence become synthetic errors.
2026-08-29 12:42:23 +08:00
wangsike f8c6b0c771 ci: drop PYTORCH_TESTING_DEVICE_FOR_CUSTOM from execution too
Keep only PYTORCH_TESTING_DEVICE_ONLY_FOR on both collection and
execution sides, fed by --device-env. Aligns the execution environment
with the collection environment (which stopped setting FOR_CUSTOM in
the previous commit) and avoids the class-rename side effect entirely.
2026-08-27 20:24:04 +08:00
wangsike 87e99e1de2 ci: drop PYTORCH_TESTING_DEVICE_FOR_CUSTOM from collection, keep ONLY_FOR only
FOR_CUSTOM at collection pulls cpu-only classes into instantiation and
mutates PrivateUse1TestBase.device_type via setUpClass, renaming
subsequent classes (TestBinaryUfuncsDevicePRIVATEUSE1 ->
TestBinaryUfuncsDeviceNPU). This diverges collected nodeids from the
execution environment and breaks skip-list matching, so 2802 known
failures escaped and failed in run 33056513132. Revert the skip-list
rename (previous commit) and stop exporting FOR_CUSTOM at collection;
--device-env now only feeds PYTORCH_TESTING_DEVICE_ONLY_FOR.
2026-08-27 20:20:30 +08:00
wangsike 863c9c2a4c ci: add device_env parameter to set PYTORCH_TESTING_DEVICE_ONLY_FOR/FOR_CUSTOM in both collection and execution
- New device_env input threaded through _test.yml -> _test-collect.yml
  (collect_all_cases.py --device-env) and _test-category.yml
  (run_npu_test_shard.py --device-env); both scripts export the value as
  PYTORCH_TESTING_DEVICE_ONLY_FOR and PYTORCH_TESTING_DEVICE_FOR_CUSTOM
  so collected nodeids always exist at run time.
- nightly.yml passes privateuse1,cpu; receive-trigger.yml passes
  privateuse1.
- Disable report_to_upstream in receive-trigger.yml (build and test)
  temporarily.
2026-08-27 16:35:31 +08:00
wangsike 0bfb442c81 ci: add disabled/running-skip testcase filtering for nightly workflow
- Add disabled_testcases.json (9848 entries) and running_skiped_testcases.json
  (4004 entries) to .github/config/
- Modify collect_all_cases.py:
  - load_skip_list() returns Dict[str, Dict] instead of set, preserving
    per-nodeid metadata (reason, category, source filename)
  - Support new JSON format: {nodeid: {reason, category, ...}}
  - --skip-list changed to action='append' for multiple files
  - filter_skipped_cases() returns (filtered, skipped) tuple, recording
    skipped cases with nodeid, file, skip_reason, skip_category, skip_source
  - main() accumulates skipped cases and saves skipped_cases.json to
    output directory, included in cases-shards artifact
  - cases_collection_summary.json adds total_skipped field
- Add extra_skip_lists input to _test.yml and _test-collect.yml (default
  empty, does not affect receive-trigger.yml)
- nightly.yml passes extra_skip_lists with both config files and reverts
  upstream to pytorch/pytorch main
- _test-report.yml copies skipped_cases.json from cases-shards artifact
  into npu-full-test-summary artifact
- receive-trigger.yml unchanged; pr_skip_list.jsonl filtering now also
  recorded in skipped_cases.json automatically
2026-08-21 09:12:03 +08:00
wangsike 1b6f35f1a2 ci: remove PYTORCH_TESTING_DEVICE_FOR_CUSTOM from collection to match execution env
FOR_CUSTOM=privateuse1 caused only_for=("cpu",) classes (e.g.
TestBinaryUfuncs) to also instantiate PrivateUse1, triggering setUpClass
which changed PrivateUse1TestBase.device_type from "privateuse1" to "npu"
as a class-attribute side effect. Subsequent instantiate calls then
generated ...DeviceNPU class names that do not exist at execution time
(no FOR_CUSTOM set in run_npu_test_shard.py), causing 13345 "collected 0
items" errors. Removing it restores collection/execution parity.
2026-08-18 22:58:31 +08:00
wangsike 1109d72448 ci: remove patch-count, rename torch-npu-whl arg, centralize docker_image
- Remove --patch-count parameter from generate_npu_full_test_report.py
  and _test-report.yml (unused, always 0)
- Rename --torch-npu-whl to --torch-npu-short to match actual input
  (short SHA, not wheel URL); update JSON output field name accordingly
- Add DOCKER_IMAGE env var to nightly.yml and receive-trigger.yml,
  pass to _test.yml via docker_image input (single source of truth)
2026-08-18 10:39:35 +08:00
wangsike a5322867e1 ci: add PYTORCH_TESTING_DEVICE_FOR_CUSTOM env var for test case collection 2026-08-18 10:28:11 +08:00
wangsike 163ee7b254 ci: derive runner display from per-category config in test report
- Modify generate_npu_full_test_report.py to build runner display string
  from cases_collection_summary.json per-category runner fields, grouping
  categories by runner label with execution mode info
- Remove hardcoded --runner argument from _test-report.yml; script now
  derives runner info from --cases-summary automatically
- Fallback to --runner arg (default N/A) if summary lacks runner data
2026-08-18 09:52:23 +08:00
wangsike c06ca8df27 ci: add per-category runner field to test category configs
- Add runner field to nightly_test_categories.yml and pr_test_whitelist.yml
  for each category (core/tensor/distributed/graph/others)
- Modify collect_all_cases.py to parse runner from config and include in
  summary JSON
- Modify _test-collect.yml to include runner_label in test_matrix output
- Modify _test.yml test job to use matrix.runner_label (per-category)
  instead of inputs.runner_label (global)
- collect job still uses inputs.runner_label (not per-category)
- _build.yml unchanged (uses inputs.runner_label globally)
2026-08-18 09:47:59 +08:00
wangsike e5507756e9 ci: add exclude config and build torchvision from source
- Add exclude support to nightly_test_categories.yml for skipping
  test/cpython (Python 3.13 syntax) and test/quantization/core/experimental
  (removed module) directories during collection
- Modify collect_all_cases.py to parse exclude list and filter files
  before classification in full-scan mode
- Add torchvision source build step in _build.yml after PyTorch install:
  pin to upstream vision.txt commit, install libpng/jpeg/webp dev headers,
  build wheel with --no-build-isolation, include in wheels tarball
- Install torchvision wheel in _test-collect.yml and _test-category.yml
  after torch/torch_npu installation
- Add .github/ci_commit_pins/vision.txt with pinned commit 0fba2e84
2026-08-13 16:11:40 +08:00
wangsike ecb2d3bb1c ci: restore GENERIC ACCELERATOR for nightly, log pytest collect command
- Restore hw_classification to 'GENERIC ACCELERATOR' in nightly.yml.
- Print the actual pytest --collect-only command for each file during
  case collection, e.g.:
  [nn/test_convolution] Collecting: python -m pytest --collect-only --quiet nn/test_convolution.py --hw-classification GENERIC ACCELERATOR
2026-08-12 15:33:16 +08:00
wangsike dfebfe7013 ci: remove PyTorch, torch_npu, and Patches rows from test report Overview 2026-08-11 21:54:25 +08:00
wangsike c4a8e845e3 ci: remove 'Patches applied' row and filter empty files from report
- Remove the 'Patches applied' row from the Overview table (always 0,
  no longer relevant).
- Skip test files with 0 planned cases in '测试文件结果汇总' table to
  reduce noise from files with no collected cases.
2026-08-11 21:32:24 +08:00
wangsike aad67b9b7b ci: show actual commit SHAs in test report instead of hardcoded values
- _build.yml: add 'Resolve torch_npu SHA' step after submodule init,
  expose torch_npu_sha/torch_npu_short as job and workflow outputs.
- nightly.yml/receive-trigger.yml: pass torch_npu_short to _test.yml.
- _test.yml: add torch_npu_short input, pass both pytorch_short and
  torch_npu_short to _test-report.yml.
- _test-report.yml: add pytorch_short/torch_npu_short inputs, replace
  hardcoded --pytorch-version 'nightly' and --torch-npu-whl 'source-build'
  with actual SHA values.
- generate_npu_full_test_report.py: remove 'v' prefix from PyTorch
  display row so commit SHA shows cleanly.
2026-08-11 21:28:19 +08:00