Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
844 commits
Select commit Hold shift + click to select a range
25d58f0
fix: add missing BackendKernelSelectorConfig parameter to QNBitGemmPa…
Rishi-Dave Apr 24, 2026
2ea847c
Add workflow to replace Windows GPU Doc Gen CI Pipeline (#28192)
tianleiwu Apr 24, 2026
d762130
Fix heap OOB write in EmbedLayerNormalizationShapeInference (#28176)
Copilot Apr 24, 2026
404fed7
[Plugin WebGPU EP] Fix API initialization error handling (#28211)
edgchen1 Apr 24, 2026
5dd7f15
[CoreML EP] Add HardSigmoid support (#28182)
maxwbuckley Apr 24, 2026
14b4d48
Fix missing include for SetRawDataInTensorProto in NV TensorRT RTX te…
ishwar-raut1 Apr 24, 2026
51e8e69
[CI] Remove win gpu doc gen and trt cuda mini CI pipelines (#28218)
tianleiwu Apr 24, 2026
2b25baf
Add packaging pipeline for CUDA plugin EP (#28152)
tianleiwu Apr 24, 2026
8b6b0b6
Add LabelEncoder CUDA execution provider for numeric types (#28045)
Copilot Apr 25, 2026
954dbce
webgpu: Refactor SubgroupMatrixMatMulNBits to vendor-agnostic config …
qjia7 Apr 25, 2026
997c479
GQA unfused attention with FP32 QK accumulation (fixes #28195) (#28198)
tianleiwu Apr 25, 2026
0992717
Add regression test for quantize_static with in-memory ModelProto (#2…
Rishi-Dave Apr 25, 2026
3c94f1c
[WebGPU] Fix MHA to ignore past key/value when no present outputs req…
vraspar Apr 27, 2026
f6eb50f
Fix heap OOB read in RNN operator via sequence_lens=0 (#28052)
vraspar Apr 27, 2026
9d2bb58
chore(ci): `NIGHTLY_BUILD` env-var is now set via pipeline parameter …
sanaa-hamel-microsoft Apr 27, 2026
1b1d453
ICM fixes (5/n) (#27971)
hariharans29 Apr 27, 2026
cf805d3
Address CI build failure (#28243)
yuslepukhin Apr 27, 2026
6e418b6
[VitisAI] pass base timestamp for vitisai profiling (#27808)
andrew0917 Apr 28, 2026
d00e297
security: replace unrestricted setattr with allowlist in Python backe…
titaiwangms Apr 28, 2026
45f5aba
[CUDA] PagedAttention: add SM<80 fp16 fallback via memory-efficient a…
elwhyjay Apr 28, 2026
2900ff7
chore(ci): temporarily remove react-native from NPM required publish …
sanaa-hamel-microsoft Apr 28, 2026
a53d6d7
[CoreML EP] Add QuickGelu support (#28184)
maxwbuckley Apr 28, 2026
7a795ed
Improve SparseTensors public API input validation as well as sparse u…
yuslepukhin Apr 28, 2026
3ae38b2
fix out of boundary vector per class in SVM (#27952)
xadupre Apr 28, 2026
8861ecd
Fix universal package version validation comment and add SHA prefix (…
edgchen1 Apr 28, 2026
1727b70
Add position_ids bounds validation to WebGPU/JS RotaryEmbedding kerne…
titaiwangms Apr 29, 2026
81802a9
Replace unsafe `reinterpret_cast` with C API calls in `include/onnxru…
edgchen1 Apr 29, 2026
f97b8c4
WebGPU: Support Split-K with batch size > 1 (#28151)
Jiawei-Shao Apr 29, 2026
037c02d
Add aarch64 wheel build to CUDA 13 Python packaging pipelines (#27760)
Copilot Apr 29, 2026
6f47410
webgpu: merge batchA into M dimension when batchB==1 (#28197)
xhcao Apr 29, 2026
8a77597
[WebNN] Rename roundingType to outputShapeRounding for pool2d ops (#2…
Honry Apr 29, 2026
ddea107
[OVEP] Updating OV version to 2026.1.0 (#28170)
preetha-intel Apr 29, 2026
df2b677
Fix cpuinfo init on Linux without CPU sysfs lists (#28230)
tianleiwu Apr 29, 2026
9a41944
Add update_inplace overload accepting OrtValue for device-to-device c…
Copilot Apr 29, 2026
abb284d
[WebGPU] Add GridSample operator (#28264)
TomCrypto Apr 29, 2026
11e3072
[Cuda] Upgrade cutlass to 4.4.2 (#28276)
tianleiwu Apr 29, 2026
99e811d
[React Native] Add react-native.config.js and Expo plugin MainApplica…
dccarmo Apr 30, 2026
464d8e9
ICM fixes (6/n) (#28255)
hariharans29 Apr 30, 2026
62f742f
Add RISC-V Vector (RVV) support for CPU Execution Provider (#28261)
velonica0 Apr 30, 2026
e295e63
Fix NPM packaging (#28238)
eserscor Apr 30, 2026
4aaf852
[NvTensorRTRTX EP] Fix build breaks with TRT-RTX 1.5+ and 1.6+ (#28263)
umangb-09 Apr 30, 2026
6f23504
WebGPU plugin EP Python packaging (#28226)
edgchen1 Apr 30, 2026
9c2b0c3
Use CUDART_VERSION reduction compatibility in GQA attention (#28296)
Copilot Apr 30, 2026
7a86574
Propagate python authentication to docker contexts (#28295)
eserscor Apr 30, 2026
5ca4e83
Language bindings for Hardware Device and EP Compatibility APIs (#28128)
xhan65 May 1, 2026
9ca299d
Implement CUDA EP Plugin profiling API (#28216)
yuslepukhin May 1, 2026
5f7e9d0
Fix session logger use-after-free during EP teardown under VERBOSE lo…
Copilot May 1, 2026
76655a0
Fix NVTX profiling: restore missing node_compute_range_.Begin() call …
Copilot May 1, 2026
d6c363c
[OVEP] OpenVINO EP 1.26.0 Development Release Updates (#28297)
ankitm3k May 1, 2026
6e19374
Fix CUDA 13 build error in gqa_unfused_attention.cu (#28309)
tianleiwu May 1, 2026
8dd4a06
Include license file in built distributions (#27783)
cjnething May 1, 2026
de2bc90
Add QNN Plugin EP repo link to README (#28225)
vraspar May 1, 2026
5f2f848
fix(ci): incorrect relative template includes for setup-feeds (#28312)
sanaa-hamel-microsoft May 1, 2026
9b30f30
remove weights_are_all_positive_ from TreeEnsemble (#27552)
xadupre May 1, 2026
d02a0fd
Fix DoubleQDQPairsRemover adding spurious dimension to scalar scale/z…
ssam18 May 1, 2026
60ce9cc
Relax GQA seqlens_k shape validation for backward compat with older m…
vraspar May 1, 2026
55c5c82
GridSample: harden float->int64 casts against NaN/Inf/out-of-range co…
GopalakrishnanN May 2, 2026
1e4ee66
add support for DFT with onesided=True and inverse=True (irfft) (#27028)
simonbyrne May 2, 2026
9d1492a
Add option to memory map .ORT model loads (#28164)
Kevin-Taha May 2, 2026
9582867
docs: add opset version notation legend to OperatorKernels.md (#28143)
Rishi-Dave May 3, 2026
763c4e3
Support ONNX overloaded functions (IR version 10+) (#28275)
gramalingam May 3, 2026
b81e0c6
Bump version for 1.27.0 (#28324)
eserscor May 4, 2026
96786ef
Bump plugin-ep-webgpu/VERSION_NUMBER to 0.2.0. (#28322)
edgchen1 May 4, 2026
f1c96d5
refactor(ci): simplify build date/time metadata propagation (#28294)
sanaa-hamel-microsoft May 4, 2026
40c9f85
Add plugin-ep-webgpu/RELEASE.md (#28321)
edgchen1 May 4, 2026
4ca6b22
Eliminate Legacy MHA Unfused path from ONNX Attention; unify on 3-tie…
titaiwangms May 4, 2026
3454f86
Fix BitShift UB when shift amount >= bit width (#28272)
Copilot May 4, 2026
a1aa3bb
adds foundry local packaging to webgpu plugin ep packaging pipeline (…
prathikr May 4, 2026
8a09501
Suppress -Wmaybe-uninitialized for onnxruntime_pybind11_state under p…
Rishi-Dave May 5, 2026
7529033
Fix ReshapeFusion dropping allowzero on inferred 0-sized intermediate…
titaiwangms May 5, 2026
b81f3f8
fix: make sympy an optional runtime dependency (#28141)
Rishi-Dave May 5, 2026
ebee606
fix(ci): test pipeline didn't correctly specify `ReleaseVersionSuffix…
sanaa-hamel-microsoft May 5, 2026
ef44604
chore: rename `ort_api_1_to_26` to `ort_api_1_to_27` (#28341)
sanaa-hamel-microsoft May 5, 2026
1f25783
Fix CUDA Attention dispatch: skip MEA when head_size != v_head_size i…
justinchuby May 5, 2026
5e38dfe
Fix CApi tests on S390x (#28074)
AlekseiNikiforovIBM May 5, 2026
07b8f39
Bump postcss from 8.5.3 to 8.5.13 in /js/web/test/e2e/exports/testcas…
dependabot[bot] May 5, 2026
c85ec49
fix(ci): 'rc' qualifier ignored when packaging `onnxruntime-node` (#2…
sanaa-hamel-microsoft May 5, 2026
80a2352
Fix round_prefer_ceil nearest mode for negative halfway values in Res…
Copilot May 5, 2026
a237323
Add CUDA plugin EP Python package pipeline (#28299)
tianleiwu May 5, 2026
513b9bf
[WebGPU plugin EP] NuGet packaging (#28313)
edgchen1 May 5, 2026
ee5158e
Fill CUDA Cast operator opset gap: extend registration from opset 23 …
Copilot May 5, 2026
28bcc9c
Fill CUDA opset gap for ReduceMax and ReduceMin (18 → 20) (#27755)
Copilot May 5, 2026
b8f21f1
Fill RNN CUDA operator opset gap (14 → 22) (#27743)
Copilot May 5, 2026
8aec1a5
Fill Reshape CUDA operator opset gap from 23 to 25 (#27742)
Copilot May 6, 2026
3e21761
Bump brace-expansion in /js/react_native/e2e (#27894)
dependabot[bot] May 6, 2026
673c332
Fill CUDA EP opset gaps for Round and Equal operators (#27754)
Copilot May 6, 2026
3b007a6
webgpu: Support QKV bias in FlashAttention for MultiHeadAttention (#2…
qjia7 May 6, 2026
dbc55db
Prevent double-free in OrtModelEditorApi ownership transfer (#28123)
vraspar May 6, 2026
5f071fb
Add M-tile loop with dispatch capping for Intel Xe2/3-LPG (#28250)
jchen10 May 6, 2026
470977a
[CoreML EP] Support pre-opset-13 Split via 'split' attribute (#28270)
maxwbuckley May 6, 2026
19738c5
[Plugin EP] Add OrtEp::OnSessionInitializationEnd() (#28319)
adrianlizarraga May 6, 2026
e3c34da
Refactor and modernize StringNormalizer. (#28320)
yuslepukhin May 6, 2026
bf76a0b
feat(quantization): add calibration cache to quantize_static (#28221)
Rishi-Dave May 7, 2026
0a341b0
[WebGPU plugin EP packaging] Remove explicit ORT package dependency (…
edgchen1 May 7, 2026
ec55d3c
Fix Subgraph_t issues with TRT RTX ver 1.5.x (#28361)
umangb-09 May 7, 2026
505e0c3
Suppress test warnings in transformers tests and fix CUDA CI (#28391)
tianleiwu May 7, 2026
058ce95
Fix CPU Attention softcap/attn_mask ordering (onnx#7867, #7913) + con…
titaiwangms May 7, 2026
245118a
[CUDA Plugin EP] Add NuGet packaging pipeline (#28378)
tianleiwu May 7, 2026
b8ba448
[C#] Add EP tests for Cuda Plugin (#28375)
yuslepukhin May 7, 2026
46273ea
[Plugin EP] Session options getters (#28377)
adrianlizarraga May 8, 2026
db03660
Remove Universal Package publishing from plugin EP packaging pipeline…
edgchen1 May 8, 2026
fe8bf3a
Fix dangling pointer of temporary return value (#28419)
rajatmonga May 8, 2026
3f49243
Fix CUDA plugin EP packaging test pipeline: host network and add cudn…
tianleiwu May 8, 2026
a2cd643
Fix loader-refcount leak in ProviderLibrary::Load on GetProvider miss…
BoarQing May 8, 2026
aa92574
[CoreML EP] Add FusedConv support (#28289)
maxwbuckley May 9, 2026
3cc4cef
Add FLOAT8E8M0 data type support in ONNX Runtime (#28381)
Copilot May 9, 2026
82f3a83
Add PEP 561 `py.typed` marker to the `onnxruntime` package (#28438)
tairenpiao May 9, 2026
4fec745
Fix CrossEntropyLoss block to support multi-output models (#28232)
Rishi-Dave May 10, 2026
8024503
Fix session use-after-free when UserLoggingFunction is used (#28314)
tianleiwu May 10, 2026
335a217
feat(quantization): add ActivationRestrictedAsymmetric option (#28237)
Rishi-Dave May 11, 2026
672c0f3
[WebGPU] Fix numerical stability issue in QMoE op (#28434)
xenova May 11, 2026
ecc41e5
Don't pin SelectorActionTransformer replacement nodes to CPU (#28288)
maxwbuckley May 11, 2026
19f5d41
Remove data hash from hashing code, to prevent unbounded growth issue…
JonathanC-ARM May 11, 2026
df11457
Harden OneHot operator input validation and output size computation (…
GopalakrishnanN May 11, 2026
0cd3de8
[WebGPU Plugin EP] Packaging pipelines minor updates (#28460)
edgchen1 May 11, 2026
1b64fba
Handle empty initializers gracefully in optimizer passes (#27976)
GopalakrishnanN May 11, 2026
c6d9a02
Fix Clang + libc++ compilation and portability issues (#28049)
mustjab May 11, 2026
67d9400
Address tokenizer shortcomings (#28428)
yuslepukhin May 12, 2026
c1a61b4
Fix CUDA plugin EP test pipeline (#28453)
tianleiwu May 12, 2026
51c546b
Validate NodeArg creation (#28429)
yuslepukhin May 12, 2026
83e402e
[GQA] Make present_key/present_value outputs optional and add Gemma4 …
apsonawane May 12, 2026
d82a06d
[CUDA] PagedAttention: use exact max_query_len on FA path (#28409)
elwhyjay May 12, 2026
8cfb63e
Add CPU Cast op support for Float8E8M0 (#28435)
tianleiwu May 12, 2026
ece097d
Add DiT attention fusion for F5-TTS and diffusion transformer models …
Rishi-Dave May 12, 2026
8d24011
Fix runtime-unresolvable type annotations in Session and InferenceSes…
Rishi-Dave May 12, 2026
a49da87
Enable QuickGeluFusion on WebGPU EP and fix fp16 shader (#28410)
xiaofeihan1 May 12, 2026
756a523
Fix sigmoid transformation in TreeEnsembleClassifier for all-positive…
Copilot May 12, 2026
a12b611
[ Cuda] ConvTranspose-22 (#27710)
tianleiwu May 12, 2026
dac5a14
Add CPU QMoE 2-bit support and LUT GEMM fast path (#28185)
tianleiwu May 12, 2026
fafe564
[WebGPU] Fix SkipSimplifiedLayerNormalization bias (#28427)
xenova May 12, 2026
183e7a9
fix: skip DQ->MatMulNBits fusion when weight/scale initializer is sha…
Rishi-Dave May 12, 2026
72bce1d
[WebGPU] Correct MatMul bias input indexing in `MatMul::ComputeIntern…
Copilot May 12, 2026
239ef9e
Use symbol file to export symbols in onnxruntime library on AIX platf…
ayappanec May 12, 2026
480aad0
Fill CUDA EP opset gap for Sin and Cos operators (7→22) (#27756)
Copilot May 12, 2026
a8260cd
[webgpu] Optimize LinearAttention Op with subgroup (#28412)
daijh May 12, 2026
469bc9f
Address Resize kernel shortcomings (#28402)
yuslepukhin May 12, 2026
0e72188
Add RVV (RISC-V Vector Extension) optimized convolution and pooling k…
velonica0 May 12, 2026
73d5416
Add LabelEncoder_4 fast path for session creation (#27526)
SamuelLess May 13, 2026
4e377a1
Use weights_only=True for remaining torch.load() calls (#28421)
adrianlizarraga May 13, 2026
ad11f7c
Fix OOB reads in SoftmaxCrossEntropyLoss via label bounds validation …
vraspar May 13, 2026
a363e89
Bound total output allocation size in Tile kernel (#28070)
GopalakrishnanN May 13, 2026
e8ae6ce
Add float zero point support for 2-bit LUT GEMM in MatMulNBits (#28354)
vraspar May 13, 2026
9b3fb24
Fixes for unicode path handling (#28390)
jnagi-intel May 13, 2026
0139499
Fill opset gap for RandomNormal, RandomNormalLike, RandomUniform, Ran…
Copilot May 13, 2026
5f72956
Address latent bug in LabelEncoder (#28496)
yuslepukhin May 14, 2026
938b607
Optimize FlashAttention for M4 Max (20x speedup) (#27780)
xenova May 14, 2026
4bc2094
Address string attribute issue (#28494)
yuslepukhin May 14, 2026
4d9aa47
Bump next from 16.1.5 to 16.1.7 in /js/web/test/e2e/exports/testcases…
dependabot[bot] May 14, 2026
0ebd8cc
fix: auto-upgrade model opset to 21 for int16/uint16 QDQ quantization…
Rishi-Dave May 14, 2026
dcf8775
CUDA Plugin Packaging Pipeline Fix TSAUpload and Timeout (#28497)
tianleiwu May 14, 2026
50d04b9
Fix out-of-bounds read in CropBase: validate scale attribute length (…
Copilot May 14, 2026
2979bab
fix: support N-D weights with unit leading dims in MatMulNBitsQuantiz…
Rishi-Dave May 14, 2026
04f7440
fix(security): add SafeInt overflow protection in Expand and constant…
tianleiwu May 14, 2026
70dcc0e
Improve error reporting for pre-allocated outputs with a wrong shape …
yuslepukhin May 14, 2026
a8ba94a
[MLAS] Add an NHWC implementation of convolution to avoid transposes …
orlmon01 May 14, 2026
b36d8db
enable dynamic max_k_step in FA for nvidia (#28511)
May 14, 2026
18ae6da
Validate per-column weight_scale/weight_zero_point shape in CPU QAtte…
edgchen1 May 14, 2026
c0b3212
Fill LSTM CUDA operator opset gap: extend coverage from opset 14 to o…
Copilot May 14, 2026
127faf0
Build issues on AIX for POWER10 and POWER11 (#26704)
KV2773 May 15, 2026
ddd1eae
Fix WeaklyCanonicalPath ERROR_ACCESS_DENIED in Windows AppContainers …
bsosnader May 15, 2026
00e9ef3
Fix input validation and null-pointer dereference in STFTDecompositio…
vraspar May 15, 2026
ad6d34c
[QNN EP] ETW log level rule change (#27593)
qti-ashwshan May 15, 2026
45c0663
Fix mlasi_sve.h preprocessor guards to allow clang compilation (#28507)
rvandermeulen May 15, 2026
eb63cc6
[MLAS] Fix scratch buffer over-allocation in batched/grouped NCHW Con…
hariharans29 May 15, 2026
b429dff
Fix Inverse kernel rank underflow before indexing trailing dims (#28400)
Copilot May 15, 2026
4f620c3
fix: avoid vector copies in CheckIfSubtreesAreEqual (#27854)
lhrios May 18, 2026
aa416f5
webgpu: Generalize FlashAttention prefill shared-memory path (#28520)
qjia7 May 18, 2026
770da7d
[WebGPU plugin EP] Package improvements (#28525)
edgchen1 May 18, 2026
22e537b
Reject recursive local function definitions during model load (#28187)
tianleiwu May 18, 2026
9883e93
contrib: add mask/input shape consistency checks in MaxpoolWithMask::…
Copilot May 18, 2026
d2453bc
Support kquant mixed for whisper export (#28515)
jiafatom May 18, 2026
40e3048
Add unit test for fix of plugin EP library handle leak in PR 28396 (#…
adrianlizarraga May 19, 2026
ce6aaee
Skip file path validation in CreateEpContextModel when the output is …
shiyi9801 May 19, 2026
2d9f35f
[Security] Validate CPU cache_indirection beam indices (#28486)
tianleiwu May 19, 2026
cd05ef4
Fix int32 overflow in CUDA Cast and UnaryElementWise kernels for tens…
Copilot May 19, 2026
8c650d8
Fix XNNPACK Gemm SIGSEGV on missing and scalar 'C' bias (#28546)
dparikh79 May 19, 2026
6a8f021
Validate sparse tensor external file paths (#28408)
adrianlizarraga May 19, 2026
b38731b
[MLAS] test: accept canonical NaN in activation NaN round-trip check …
qiurui144 May 19, 2026
4d1dce8
Add EP and hardware device type to Windows ML telemetry (#28477)
angelser May 19, 2026
192ef6b
Fix protoc error when cross compiling on a linux aarch64 host (#28567)
jocelyn-stericker May 19, 2026
a48b498
Fix Cargo registry auth for network-isolated Linux Python wheel build…
kpkbandi May 19, 2026
3a071a6
[MLAS] Correcting Compilation Errors: onnxruntime/onnxruntime/core/ml…
zejianzhang1982 May 20, 2026
548ab6e
QMoE CUDA EP — FP4/FP8/WFP4AFP8 Quantized Mixture-of-Experts + MoE GE…
tianleiwu May 20, 2026
f6e8b0b
add more ORT_ENFORCE when building the tree structure of TreeEnsemble…
xadupre May 20, 2026
6fbda6d
Add quantized KV cache support in CPU GroupQueryAttention (#28576)
tianleiwu May 20, 2026
1363017
Derive ORT_TEST_VERBOSE from System.Debug via runtime coalesce in plu…
edgchen1 May 20, 2026
bdcd029
Add linux-arm64 binaries to the foundry nuget package (#28579)
baijumeswani May 20, 2026
d0203e1
[CoreML EP] Add Identity, Ceil, Tile builders + drop trivial-only par…
maxwbuckley May 20, 2026
856c546
Fix EpGraphAssignmentInfo missing issue on nodes assigned to CPU-EP b…
qti-hungjuiw May 20, 2026
8d644e5
fix: guard ORT_USE_CPUINFO on __linux__ to fix FreeBSD build (#28362)
Rishi-Dave May 20, 2026
559162f
fix: propagate output_dtype attribute when inserting Q after DQ (#28144)
Rishi-Dave May 20, 2026
5996a1e
feat(orttraining): add CPU fallback for FusedAdam optimizer (#28233)
Rishi-Dave May 20, 2026
4236d6e
Fail loudly when MatMulNBits receives unsupported block_size on CPU E…
Copilot May 20, 2026
5664066
CPU GroupQueryAttention: Quantized KV Cache with SIMD-optimized MLAS …
tianleiwu May 21, 2026
ae88f9b
QMoE CUDA: Rename build options, refactor PrePack, add GPU kernels (#…
tianleiwu May 21, 2026
86aae8c
Fix Whisper genai_config context_length using wrong config attribute …
jiafatom May 21, 2026
67156b8
Move `OrtEp` sanity checks to plugin EP creation and remove check for…
edgchen1 May 21, 2026
a894893
Address MaxUnpool shortcomings msrc116345 (#28550)
yuslepukhin May 21, 2026
84d03c5
[WebGPU plugin EP] Add Win ARM64 Python package (#28526)
edgchen1 May 21, 2026
158bdef
Fix oob bias access for MatMulIntegerToFloat and DynamicQuantizeMatMu…
adrianlizarraga May 21, 2026
ee444bd
Validate conv bias shape in WordConvEmbedding to prevent OOB read (#2…
apsonawane May 21, 2026
cf8e4f5
[CoreML EP] Support Gather with scalar 'indices' (#28278)
maxwbuckley May 21, 2026
e10b9a8
Add component governance manifest for WebGPU EP (#28599)
adrastogi May 22, 2026
1e80c29
Validate seqlens_k against cos_cache bounds in GroupQueryAttention to…
apsonawane May 22, 2026
e3655b3
Parallelize CPU ScatterElements kernel via ThreadPool (#28588)
Copilot May 22, 2026
b850fcb
[NVEP]: fix test for multi-gpu situation (#27837)
theHamsta May 22, 2026
43989a7
QMoE CUDA: input validation, prepack cleanups, and packaging pipeline…
tianleiwu May 22, 2026
5003d93
Fix CUDA build with contrib ops disabled (#28554)
Copilot May 22, 2026
d2836a8
Optimize MLAS quantized KV-cache GEMM kernels (follow-up to #28578) (…
tianleiwu May 22, 2026
359d9ab
fix(qdq): skip DQ forward propagation when DQ input is constant (#28521)
Rishi-Dave May 22, 2026
1053327
[WebGPU] LinearAttention: increase tile_v when subgroups are availabl…
daijh May 22, 2026
a4f40c1
Fix Reshape with allowzero=1 producing wrong shape for zero-size tens…
Copilot May 22, 2026
a4f79e8
Fix: Accept 'CPU' as a valid provider name in SessionOptionsAppendExe…
jiafatom May 22, 2026
b2f6e15
[MLAS] RVV-Optimized LLM Operators for RISC-V (#28518)
velonica0 May 23, 2026
d464b2a
Add example and documentation for kOrtEpDevice_EpMetadataKey_OSDriver…
adrastogi May 23, 2026
a1fc916
Additional diagnostics for DML failure path (#28495)
adrastogi May 23, 2026
c5afcc5
Fix Erf NaN preservation on x86_64 FMA3 path (#28615)
tairenpiao May 25, 2026
c267f8e
Optimize MatMulNBits 2-bit + float zero_point CPU dequantization with…
Copilot May 25, 2026
b5fb2b8
[Annotations] Address cuda orginal matching (#28623)
yuslepukhin May 26, 2026
7a3f9a2
Raise protobuf minimum version in Python requirements (#28558)
anzzraju1997-glitch May 26, 2026
97cfc86
Update GatherBlockQuantized to support 2-bits (#28530)
HectorSVC May 26, 2026
e0a8dac
rev some npm packages (#28547)
May 26, 2026
30b6528
lstm support for webgpu (#27881)
May 26, 2026
2c4a0c1
Fix plugin EP test failure when host ORT lacks newer data types (#28659)
tianleiwu May 26, 2026
c85f6eb
Add --test_parallel to reduce CTest concurrency for ASan builds (#28675)
tianleiwu May 26, 2026
12916e9
Check weight shape dimensions in ConvTranspose shape inference msrc11…
yuslepukhin May 26, 2026
a42351e
remove some webgpu ci tasks to speedup ci (#28642)
May 27, 2026
1f92c9d
Fix CUTLASS FMHA BiasLoader alignment for unaligned kernel path (#28369)
justinchuby May 27, 2026
bdd52fa
Propagate outer scope type info to subgraphs during verification (#27…
Rishi-Dave May 27, 2026
b0924f4
Speed up CUDA CI build: split into per-arch OBJECT libraries, add --f…
tianleiwu May 27, 2026
71cfbb0
[CoreML EP] Add Sin and Cos unary ops (#28596)
maxwbuckley May 27, 2026
53fcead
Guard removed APIs in TRT 11 (#28611)
kevinch-nv May 27, 2026
b188061
[WebGPU plugin EP] Enforce minimum ORT version specified by `plugin-e…
edgchen1 May 27, 2026
26871ab
Use fp32 accumulation in SkipLayerNorm/EmbedLayerNorm CUDA kernels (#…
tianleiwu May 27, 2026
46fdcbb
Update GQA op schema (#28689)
apsonawane May 27, 2026
5d6cbb6
[webgpu] Per-graph buffer manager for WebGPU multi-graph capture (#28…
qjia7 May 28, 2026
04c900d
Update protobuf version to 6.33.5 (#28684)
sushraja-msft May 28, 2026
88ca23f
[WebGPU] QKV and MLP layer fusions for Qwen3-style models (#28280)
hariharans29 May 28, 2026
efbffdd
Address CUDA ReduceL2 negative results and add test coverage (#28681)
yuslepukhin May 28, 2026
4b7f8f1
[WebGPU EP] Add environment variable to dump shader code to a file, m…
edgchen1 May 28, 2026
f1b1305
Replace direct inclusion of <cub/cub.cuh> with "core/providers/cuda/c…
edgchen1 May 28, 2026
b668e47
fix(quantization): emit axis on DequantizeLinear for per-channel dyna…
Rishi-Dave May 28, 2026
eefc22f
fix(partitioning_utils): include Loop/If/Scan implicit inputs in Meta…
zz002 May 28, 2026
77d32c3
Address external path references in loaded models (#28709)
yuslepukhin May 29, 2026
7e82d19
Flash Attention style tiled computation for CPU GQA quantized KV cach…
tianleiwu May 29, 2026
abbc2ab
Add `tools/python/compile_contributors.py` `--paths` option (#28710)
edgchen1 May 29, 2026
60c5ecc
Fix stream_ nullptr bug and enable end-to-end HIP graph capture
zhihuidu-amd May 29, 2026
9331192
Fix misspell lint: analogue->analog, overriden->overridden
zhihuidu-amd May 31, 2026
c548e9c
Fix misspell lint: recognise->recognize, behaviour->behavior in trigg…
zhihuidu-amd Jun 1, 2026
0851d72
Fix misspell lint: unrecognised->unrecognized in trigger_and_wait_pip…
zhihuidu-amd Jun 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
267 changes: 267 additions & 0 deletions .agents/skills/cuda-attention-kernel-patterns/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
---
name: cuda-attention-kernel-patterns
description: Patterns and pitfalls for the ONNX domain Attention operator (opset 23/24) CUDA implementation. Use when modifying the dispatch cascade in core/providers/cuda/llm/attention.cc, writing mask/bias CUDA kernels, debugging attention test routing, or adding features to the ONNX Attention op. NOT for contrib domain MultiHeadAttention/GroupQueryAttention.
---

# ONNX Domain Attention (Opset 23/24) CUDA Patterns

Reusable knowledge from ONNX Attention CUDA development in ORT.

> **Scope**: This skill covers the **ONNX domain** `Attention` operator (opset 23/24)
> implemented at `core/providers/cuda/llm/attention.cc`. This is **separate from** the
> contrib domain `MultiHeadAttention` / `GroupQueryAttention` at `contrib_ops/cuda/bert/`.
> They share some underlying kernels (CUTLASS FMHA, Flash Attention) and infrastructure
> (`attention_softmax.h`) but have **different dispatch logic, parameter structs, and eligibility checks**.
>
> - **Shared infrastructure**: CUTLASS FMHA kernel, Flash kernel, unified unfused kernel
> (`unfused_attention.cu`), `attention_softmax.h`, `attention_impl.cu` (contrib only)
> - **ONNX-specific**: Dispatch cascade in `attention.cc`, `ConvertAttnMaskToBias`,
> `mask_filter_value` cap, parameter bridge to contrib structs, `attention_mask_impl.cu`
> - **Contrib-specific**: Own dispatch in contrib MHA/GQA ops, uses `contrib::AttentionParameters`
> directly, has XQA kernel, past-present buffer sharing

## 1. Runner Dispatch Cascade

CUDA attention dispatches in priority order: **Flash → MEA (Memory Efficient) → Unified Unfused Attention**.

```
// onnxruntime/core/providers/cuda/llm/attention.cc — ComputeInternal()
Flash eligible? → RunFlashAttention()
↓ no
MEA eligible? → RunMemoryEfficientAttention()
↓ no
Unified Unfused → RunUnfusedAttention()
(handles both MHA and GQA via reshape-Q trick)
```

**Flash eligibility**: fp16/bf16 only, SM≥8.0 (Ampere+), `head_size == v_head_size`, `head_size <= 256`, no `output_qk`, `attn_mask == nullptr`. Uses `mha_fwd` / `mha_fwd_kvcache`.

**MEA eligibility**: SM50+/53+/80+ by dtype, `head_size <= 1024` and divisible by 8 (enforced by `has_memory_efficient_attention`), no `output_qk`. GQA additionally requires `head_size == v_head_size` (for `LaunchUngroup`); decode also requires it (for `LaunchConcatNewToPastKV`). Bias stride must satisfy `total_sequence_length % 4 == 0`. GQA with FP32 is excluded (LaunchUngroup only has fp16/bf16 instantiations). Supports `softcap + attn_mask` — CUTLASS applies softcap before bias in kernel tiles, matching ONNX spec ordering (onnx/onnx#7867, supersedes the now-closed onnx/onnx#7865 issue).

**Unified Unfused Attention**: Always available as the final fallback. Handles both MHA (`num_heads == kv_num_heads`, group=1) and GQA (`num_heads != kv_num_heads`, group>1) via a reshape-Q trick with stride-based cuBLAS batched GEMM (no K/V head replication). Uses FP32 QK scratch for precision. Supports all features:
- softcap + attn_mask (spec-correct ordering)
- output_qk (kQK mode: copies raw QK before softcap/mask mutations)
- past_key + past_value with `head_size != v_head_size` (separate K/V concat)
- causal masking, nonpad_kv_seqlen, all dtypes (fp16/bf16/fp32)

## 2. CUTLASS kLog2e Overflow

CUTLASS `iterative_softmax` multiplies all attention scores by `kLog2e ≈ 1.4427` internally (for `exp2f` instead of `expf`). For float/bf16:

```
mask_filter_value = std::numeric_limits<float>::lowest() ≈ -3.40e+38
-3.40e+38 × 1.4427 ≈ -4.91e+38 → overflows fp32 → -inf
```

When all values become `-inf`, CUTLASS's special-case path produces `s_prime=0` → `1/s_prime=inf` → `0 × inf = NaN`.

**Fix**: Cap `mask_filter_value` to `-1.0e+30f` in `ConvertAttnMaskToBias`. This value is safe: `1e30 × 1.4427 ≈ 1.4e30 << FLT_MAX`, and `exp(-1e30) ≈ 0` (effectively masked).

**fp16 is NOT affected**: `lowest() = -65504`, and `-65504 × 1.4427 ≈ -94500` stays within fp32 range.

This cap is ONLY applied in MEA paths. The unfused path uses `lowest()` directly (its softmax subtracts max first, avoiding overflow).

**Subtlety**: When bias is present (`kSupportsBias=true`), CUTLASS pre-applies `p.scale` to QK (line 858) and uses `scaling=1.0f` in the softmax loop (line 981). So the full `kLog2e` multiplier hits the bias-dominated values — the overflow is head_size-independent. Without bias, `scaling = p.scale * kLog2e = kLog2e/sqrt(head_size)`, which is much smaller.

## 3. Bias Alignment

CUTLASS FMHA requires the attention bias row stride to satisfy minimum alignment. The bias has shape `[B, H, S, T]` where `T = total_sequence_length` is the row stride.

```cpp
constexpr int min_bias_align = 4; // elements, not bytes
if (parameters.total_sequence_length % min_bias_align != 0) {
mea_eligible = false; // fall through to unfused
}
```

**Impact on tests**: If a test uses `total_sequence_length` not divisible by 4 (e.g., past=5 + new=6 = 11), MEA is rejected and unfused handles it. To test MEA with bias, ensure `total_sequence_length % 4 == 0`.

## 4. Softcap Ordering

ONNX Attention opset 23/24 spec ordering (per onnx/onnx#7867, which superseded
the now-closed onnx/onnx#7865 issue, and onnx/onnx#7913 which swapped
`qk_matmul_output_mode` values 1 and 2 to align with the corrected pipeline):

```
scale * (Q @ K^T) # stage 0: raw scaled QK
|
softcap (if > 0) # stage 1: tanh(qk / softcap) * softcap
|
+ attn_bias / + attn_mask # stage 2: additive (mask -inf survives to stage 3)
|
softmax # stage 3
|
@ V
```

`qk_matmul_output_mode` integer values follow pipeline stage order:
0 = raw scale*QK, 1 = post-softcap (pre-mask), 2 = post-mask/bias (pre-softmax),
3 = post-softmax.

CUDA implementation status (all spec-correct):
- **MEA (CUTLASS)**: `kernel_forward.h` applies softcap inside the score-compute
tile loop BEFORE `attn_bias` is added.
- **Flash**: `mha_fwd` / `mha_fwd_kvcache` handle softcap natively; reject
explicit `attn_mask`, so ordering with float mask is moot for this path.
- **Unfused**: `UnfusedSoftmaxKernel` does `QK -> scale -> softcap -> add bias -> softmax`
(all fused).

CPU implementation status: `core/providers/cpu/llm/attention.cc::ComputeAttentionProbs<T>`
applies softcap BEFORE the mask add (post-fix; pre-fix it inverted the order
and leaked probability through masked positions).

Why this ordering matters: a -inf in `attn_mask` must survive to softmax. If
softcap were applied AFTER the mask-add, then `tanh(-inf/softcap) * softcap = -softcap`
(a finite value), and softmax would assign non-zero weight to the masked
position — leaking poison V values into the output. The CUDA-side guard tests
at `test_onnx_attention/test_gqa.py:1501` and `:1761`, and the CPU-side guards
at `TestONNXAttentionCPUSoftcapMaskOrdering` in the same file, exercise this
property by combining small softcap, a -inf mask entry, and a poison V value.

## 5. Grid-Stride Loops for CUDA Kernels

Always cap grid size to prevent exceeding `gridDim.x` limits, and use grid-stride loops for large workloads:

```cpp
constexpr int64_t kMaxGridDimX = 65535;
int threads = static_cast<int>(std::min(static_cast<int64_t>(max_threads_per_block), total));
int64_t blocks = (total + threads - 1) / threads;
unsigned int grid_size = static_cast<unsigned int>(std::min(blocks, kMaxGridDimX));

MyKernel<<<grid_size, threads, 0, stream>>>(...);

// Inside the kernel:
for (int64_t idx = blockIdx.x * blockDim.x + threadIdx.x;
idx < total;
idx += static_cast<int64_t>(gridDim.x) * blockDim.x) {
// work
}
```

**Never** cast `int64_t` block count directly to `unsigned int` without capping — it silently truncates.

Always call `CUDA_CALL(cudaGetLastError())` after kernel launches in standalone helper functions. This is the established pattern in the file (see `ConcatPastToPresent`, `PastPresentBufferShare`).

## 6. Fully-Masked Batches

All-false bool masks or `seqlens_k=0` produce NaN in CUTLASS MEA.

**Additive-bias path** (bool mask converted to bias): Fixed by capping `mask_filter_value` to `-1e+30f` (see section 2). CUTLASS then naturally computes uniform softmax → mean(V).

**Nonpad path** (`seqlens_k=0`): CUTLASS skips all K/V positions → `s_prime=0` → NaN. Fixed by `ZeroOutputForFullyMaskedBatches` kernel which zeros output for batches where `seqlens_k[b] == 0`. Note: this produces zeros, not mean(V) — a cross-EP consistency TODO exists.

**CPU/Unfused behavior**: `mask_filter_value = lowest()` (not `-inf`). All masked values are equal → `softmax(equal) = 1/N` → output = mean(V). This is the spec reference.

## 7. Test Runner Targeting

Use `ScopedEnvironmentVariables` to force specific CUDA runners:

```cpp
// Force MEA (disable Flash)
ScopedEnvironmentVariables scoped_env({
{"ORT_DISABLE_FLASH_ATTENTION", "1"},
});

// Force Unfused (disable both Flash and MEA)
ScopedEnvironmentVariables scoped_env({
{"ORT_DISABLE_FLASH_ATTENTION", "1"},
{"ORT_DISABLE_MEMORY_EFFICIENT_ATTENTION", "1"},
});
```

**Always verify which runner a test actually hits.** A test designed for MEA may silently fall to unfused if:
- `total_sequence_length % 4 != 0` (bias alignment)
- `head_size != v_head_size` (decode path)
- fp32 dtype with GQA (LaunchUngroup fp16/bf16 only)
- fp32 dtype on SM < 80

Enable verbose logging to confirm: `LOGS_DEFAULT(VERBOSE) << "ONNX Attention: using ..."`.

## 8. Cross-EP Consistency

CPU is the spec reference implementation. CUDA outputs should match CPU for all valid inputs.

- CPU uses `mask_filter_value = std::numeric_limits<T>::lowest()` (finite, not `-inf`)
- CPU softmax: subtract-max-first → works correctly with extreme finite values
- CPU handles fully-masked batches naturally (uniform softmax → mean(V))

Run tests with `disable_cpu=false` to always validate against CPU. The C++ test framework (`RunTest4D`) supports `disable_cpu`, `disable_cuda`, `disable_dml` flags.

## 9. File Locations

### ONNX Domain (this op's code)

| File | Purpose |
|------|---------|
| `core/providers/cuda/llm/attention.cc` | ONNX Attention CUDA dispatch: Flash/MEA/Unfused cascade, `ConvertAttnMaskToBias`, parameter setup |
| `core/providers/cuda/llm/attention_mask_impl.cu` | ONNX-specific mask/bias CUDA kernels: bool→bias, nonpad→seqlens_k, ZeroOutput, bias composition |
| `core/providers/cuda/llm/attention_mask_impl.h` | Declarations for ONNX mask/bias kernels |
| `core/providers/cpu/llm/attention.cc` | CPU reference implementation (ONNX domain) |
| `core/providers/cpu/llm/attention_helper.h` | ONNX parameter validation and shape computation |
| `test/providers/cpu/llm/attention_op_test.cc` | C++ attention tests (all EPs) |
| `test/python/transformers/test_onnx_attention/test_mha.py` | Python parity tests |
| `test/python/transformers/test_onnx_attention/common.py` | Python test utilities and reference `attention_ref()` |

### Shared Infrastructure (used by both ONNX and contrib ops)

| File | Purpose |
|------|---------|
| `contrib_ops/cuda/bert/unfused_attention.cu` | Unified unfused attention: QK GEMM (FP32), fused softmax kernel (scale+softcap+bias+causal), V GEMM. Handles MHA and GQA. |
| `contrib_ops/cuda/bert/unfused_attention.h` | `UnfusedAttentionParams`, `LaunchUnfusedAttention`, workspace size |
| `contrib_ops/cuda/bert/attention_impl.cu` | Legacy unfused `QkvToContext` (contrib MHA only). Also `ApplySoftcap`, `ConcatPastToPresent` |
| `contrib_ops/cuda/bert/attention_softmax.h` | CUDA softmax kernels (`ComputeSoftmax`, `ComputeSoftmaxWithRawMask`) — used by legacy contrib path |
| `contrib_ops/cuda/bert/cutlass_fmha/` | CUTLASS FMHA (Memory Efficient Attention) kernels |
| `contrib_ops/cuda/bert/flash_attention/` | Flash Attention kernels |

### Contrib Domain (separate ops, NOT covered by this skill)

| File | Purpose |
|------|---------|
| `contrib_ops/cuda/bert/multihead_attention.cu` | Contrib `MultiHeadAttention` — own dispatch, uses `contrib::AttentionParameters` directly |
| `contrib_ops/cuda/bert/group_query_attention.cu` | Contrib `GroupQueryAttention` — has XQA kernel, past-present buffer sharing |

## 10. Parameter Bridge (ONNX → Contrib)

The ONNX Attention op uses `attention_helper::AttentionParameters` (in `core/providers/cpu/llm/attention_parameters.h`). The unified unfused kernel (`LaunchUnfusedAttention`) uses its own `UnfusedAttentionParams` struct populated directly from ONNX parameters in `RunUnfusedAttention`.

The contrib `QkvToContext` function (used by contrib MHA, NOT by ONNX Attention) uses `contrib::AttentionParameters`. ONNX Attention does **not** bridge to `contrib::AttentionParameters` — it routes through the unified unfused kernel instead.

## 11. Causal Alignment

The ONNX spec defines two causal alignment modes based on where query positions sit in the full attention matrix:

- **Upper-left**: `q_i` attends to `kv[0..i]`. Query positions start at 0 in the full matrix.
- **Lower-right**: `q_i` attends to `kv[kv_len - q_len + i..kv_len - 1]`. Query positions are at the end.

**ONNX spec rule**: `is_causal=1` always means upper-left in the full matrix. When `past_key` provides context, `past_sequence_length` shifts the query start position forward — the resulting `[S_q × total_kv]` sub-matrix effectively has lower-right alignment.

### Per-kernel behavior

| Kernel | Alignment | Mechanism |
|--------|-----------|-----------|
| **Flash** | Lower-right only | `is_causal` flag → `seqlen_k - seqlen_q` offset in kernel. No top-left option. |
| **MEA (CUTLASS)** | Both | `causal_from_top_left` flag in `MemoryEfficientAttentionParams`. `true` → `CausalFromTopLeft` (offset=0). `false` → `CausalFromBottomRight` (offset = num_keys - num_queries). |
| **Unfused** | Both | `past_kv_length` param. `0` → upper-left. `total_kv - S_q` → lower-right. |

### Dispatch logic in attention.cc

```cpp
// Flash cannot do upper-left → guarded by causal_cross_no_past
bool causal_cross_no_past = parameters.is_causal &&
parameters.q_sequence_length != parameters.total_sequence_length &&
parameters.past_sequence_length == 0;

// Flash: skip when causal_cross_no_past (no top-left support)
// MEA: NOT skipped — handles it via causal_from_top_left = (past_sequence_length == 0)
// Unfused: always correct via past_kv_length = parameters.past_sequence_length
```

### When S_q == S_kv

Upper-left and lower-right produce **identical** results when `S_q == S_kv` (the offset is 0 either way). The alignment distinction only matters for cross-attention shapes (`S_q != S_kv`).

### TensorScatter decode (opset 24 external KV cache)

TensorScatter manages KV cache externally — `past_key` is nullptr but K/V already contain the full sequence. Per the ONNX spec, `is_causal` with `S_q != S_kv` and no `past_key` means upper-left (q[0] sees only kv[0]), which is **not meaningful for decode**.

**Correct pattern**: TensorScatter decode must use `is_causal=0` and rely on `nonpad_kv_seqlen` to bound the active KV range. Models using `is_causal=1` with TensorScatter decode have a spec-invalid combination.
85 changes: 85 additions & 0 deletions .agents/skills/ort-build/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: ort-build
description: Build ONNX Runtime from source. Use this skill when asked to build, compile, or generate CMake files for ONNX Runtime.
---

# Building ONNX Runtime

The build scripts `build.sh` (Linux/macOS) and `build.bat` (Windows) delegate to `tools/ci_build/build.py`.

## Build phases

Three phases, controlled by flags:

- `--update` — generate CMake build files
- `--build` — compile (add `--parallel` to speed this up)
- `--test` — run tests

For native builds, if none are specified (and `--skip_tests` is not passed), **all three run by default**. For cross-compiled builds, the default is `--update` + `--build` only.

### When to use `--update`

You need `--update` when:
- First build in a new build directory
- New source files are added (some CMake targets use glob patterns, others use explicit file lists — re-run to pick up new files either way)
- CMake configuration changes (new flags, updated CMakeLists.txt)

You do **not** need `--update` when only modifying existing `.cc`/`.h` files — just use `--build`. Skipping it saves time.

## Examples

```bash
# Full build (update + build + test)
./build.sh --config Release --parallel
.\build.bat --config Release --parallel # Windows

# Just regenerate CMake files
./build.sh --config Release --update

# Just compile (skip CMake regeneration and tests)
./build.sh --config Release --build --parallel

# Just run tests (after a prior build)
./build.sh --config Release --test

# Build with CUDA execution provider
./build.sh --config Release --parallel --use_cuda --cuda_home /usr/local/cuda --cudnn_home /usr/local/cuda

# Build Python wheel
./build.sh --config Release --parallel --build_wheel

# Build a specific CMake target (much faster than a full build)
./build.sh --config Release --build --parallel --target onnxruntime_common

# Load flags from an option file (one flag per line)
./build.sh "@./custom_options.opt" --build --parallel
```

## Key flags

| Flag | Description |
|------|-------------|
| `--config` | `Debug`, `MinSizeRel`, `Release`, or `RelWithDebInfo` |
| `--parallel` | Enable parallel compilation (recommended) |
| `--skip_tests` | Skip running tests after build |
| `--build_wheel` | Build the Python wheel package |
| `--use_cuda` | Enable CUDA EP. Requires `--cuda_home`/`--cudnn_home` or `CUDA_HOME`/`CUDNN_HOME` env vars. On Windows, only `cuda_home`/`CUDA_HOME` is validated. |
| `--target T` | Build a specific CMake target (requires `--build`; e.g., `onnxruntime_common`, `onnxruntime_test_all`) |
| `--build_dir` | Build output directory |

## Build output path

Default: `build/<Platform>/<Config>/` where Platform is `Linux`, `MacOS`, or `Windows`.

With Visual Studio multi-config generators, the config name appears twice (e.g., `build/Windows/Release/Release/`).

It may be customized with `--build_dir`.

## Agent tips

- **Activate a Python virtual environment** before building. See "Python > Virtual environment" in `AGENTS.md`.
- **Prefer `python tools/ci_build/build.py` directly** over `build.bat`/`build.sh` when redirecting output. The `.bat` wrapper runs in `cmd.exe`, which breaks PowerShell redirection.
- **Redirect output to a file** (e.g., `> build_log.txt 2>&1`). Build output is large and will overflow terminal buffers.
- **Run builds in the background** — a full build can take tens of minutes to over an hour. Poll the log for `"Build complete"` or errors.
- **Use `--parallel`** by default unless the user says otherwise.
- Ask the user what they want to build (config, execution providers, wheel, etc.) if not clear from their prompt.
Loading
Loading