workspace-estimation-shared-header
Skill22k starsChanged 3 months agoMITView on GitHub
Use when editing a boundary-safe shared header meant to be included by both in-tree and shared-provider/plugin-bridge code (e.g. include/onnxruntime/core/framework/workspace_requirement.h, or any future header supporting OrtKernelWorkspaceEstimateFunc / DeclareWorkspaceRequirements per issue #29775's Phase-A workspace-estimation roadmap), or when a workspace-estimation math helper needs to be callable from a future plugin EP DLL. Covers a Node forward-declaration ODR trap and the math-helper vs. graph-parsing-wrapper reuse boundary discovered while implementing PR #29811 (MatMulNBits pilot).
Trending
Less talk lately.about the whole repository
Who's talking about microsoft/onnxruntime
- A Hacker News story“ONNX Runtime merges WebGPU backend”Hacker News · Apr 24, 2023 · 178 points
- immich-app/immich“feat(ml): introduce support of onnxruntime-rocm for AMD GPU”GitHub · Jul 12, 2024 · 28 reactions
- Unstructured-IO/unstructured“feat/numpy_2”GitHub · Oct 1, 2024 · 17 reactions
- microsoft/vcpkg“[onnxruntime] new ports for microsoft/onnxruntime v1.23.2”GitHub · Feb 19, 2024 · 17 reactions
- huggingface/transformers.js“Can GPU acceleration be used when using this library in a node.js environment?”GitHub · Feb 7, 2024 · 17 reactions
The biggest 5 of 39 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 39
Talked about on GitHub, Hacker News, Bluesky and the web (39 times).
On GitHub · 32
- Jul 12, 2024feat(ml): introduce support of onnxruntime-rocm for AMD GPU — immich-app/immich28 reactions · 58 comments
- Oct 1, 2024feat/numpy_2 — Unstructured-IO/unstructured17 reactions · 10 comments
- Feb 19, 2024[onnxruntime] new ports for microsoft/onnxruntime v1.23.2 — microsoft/vcpkg17 reactions · 80 comments
- Feb 7, 2024Can GPU acceleration be used when using this library in a node.js environment? — huggingface/transformers.js17 reactions · 6 comments
- Jan 21, 2024FAQ/GUIDE: I've figured out why CUDA isn't available in Insightface! — cubiq/ComfyUI_IPAdapter_plus17 reactions · 14 comments
27 more on GitHub
- Jan 8, 2020[request] some of most relevant c++ libraries in github (by number of stars) — conan-io/conan-center-index16 reactions · 132 comments
- Jun 18, 2024feat: add support for custom ai models | Pipeline API RFC — supabase/edge-runtime14 reactions · 18 comments
- Mar 16, 2021Add support for anchor tags — lycheeverse/lychee13 reactions · 39 comments
- May 14, 2024wanted: microsoft/onnxruntime — bazelbuild/bazel-central-registry11 reactions · 3 comments
- Mar 6, 2021[request] onnxruntime/1.7.1 — conan-io/conan-center-index11 reactions · 11 comments
- Nov 13, 2025Getting wrong .NET version — actions/setup-dotnet10 reactions · 18 comments
- May 8, 2025Enable Android 16 KB page size support — microsoft/onnxruntime-extensions9 reactions · 14 comments
- Apr 11, 2024Expose onnxruntime session options (intra_op_num_threads) — deepinsight/insightface9 reactions
- Sep 16, 2020Exporting the pytorch grid_sample operator to ONNX opset version 9 is not supported — pytorch/pytorch7 reactions · 1 comment
- Dec 29, 2023wasm does not work on node right now with multiple threads — huggingface/transformers.js6 reactions · 3 comments
- Mar 22, 2022Define layer normalization as a function — onnx/onnx6 reactions
- Dec 2, 2020[onnxruntime] Add new port — microsoft/vcpkg6 reactions · 28 comments
- Jul 28, 2026(partially) fix #23462: configure onnxruntime to stop VRAM usage from growing — immich-app/immich5 reactions · 4 comments
- Jul 23, 2024windows 10 installation tutorial (win10 安装教程) — warmshao/FasterLivePortrait5 reactions · 1 comment
- Nov 30, 2023[ROCm] TunableOp — pytorch/pytorch5 reactions · 31 comments
- Apr 15, 2025[DO NOT SUBMIT] Model cache POC — shiyi9801/chromium4 reactions · 2 comments
- Nov 19, 2024GafferML — GafferHQ/gaffer4 reactions · 3 comments
- Apr 15, 2026Add support for q1, q1f16, q2, q2f16 data types — huggingface/transformers.js3 reactions · 1 comment
- Dec 26, 2025onnx and onnxruntime bump versions (fixed onnx dependency with shared=True) — conan-io/conan-center-index3 reactions
- Nov 4, 2025python3Packages.rapidocr-onnxruntime: fix aarch64-linux build — NixOS/nixpkgs3 reactions · 7 comments
- Feb 26, 2025introduce "--webnn-ort-ov-gpu-precision" to specify gpu precision — shiyi9801/chromium3 reactions · 1 comment
- Feb 4, 2025Add: WASM Emscripten example — pykeio/ort3 reactions · 33 comments
- Feb 1, 2025Object mask — darktable-org/darktable3 reactions · 5 comments
- Sep 23, 2024C, C++, and Python API for Adapters (Multi-LoRA and others) — microsoft/onnxruntime-genai3 reactions
- Dec 12, 2023relax protobuf restriction — microsoft/onnxconverter-common3 reactions · 12 comments
- Apr 1, 2023onnxruntime: add 1.14.1 — conan-io/conan-center-index3 reactions · 36 comments
- Jan 14, 2022Add Col2Im operator — onnx/onnx3 reactions · 21 comments
On Hacker News · 5
- Apr 24, 2023ONNX Runtime merges WebGPU backend178 points · 35 comments
- Jan 19, 2020ONNX Runtime: cross-platform, high performance scoring engine for ML models8 points · 1 comment
- Sep 26, 2025ONNX Runtime v1.23.0 Released4 points
- Dec 11, 2020ONNX Runtime v1.6.0 Release1 point
- Oct 31, 2019Microsoft collects telemetry in onnxruntime Python module1 point
On Bluesky · 1
- Aug 22, 2026📦 microsoft / onnxruntime ⭐ 21,420 (+5) 🗒 C++ ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator — @github-trending.bsky.social1 likes and repost
On the web · 1
- Oct 21, 2026microsoft/onnxruntime - GitHub Explorer — ghe.derekchia.com
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- code-reviewSkill
- contrib-op-shape-inference-memory-safetySkill
- cuda-attention-kernel-patternsSkill
- cuda-cutlass-fmha-incremental-rebuildSkill
- onnx-opset-bump-checklistSkill
- ort-buildSkill
- ort-ciSkill
- ort-lintSkill
- ort-release-notesSkill
- ort-testSkill
- ort-transformers-gpu-pytestSkill
- python-kwargs-setattr-securitySkill
- webgpu-local-testingSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 40
When a kernel's workspace-size computation needs to be callable from both in-tree and (eventually) plugin code, split it into two pieces:
- Distinctive: line 53
Why this matters concretely: if you accidentally let the pure-math core accept or touch an in-tree graph type (even just to read one …
- Distinctive: line 61
If you find a graph type anywhere in that function, the split has leaked and needs to be pulled apart before a plugin implementation can …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Workspace-Estimation Shared Header: DLL-Boundary Pitfalls
Lessons from implementing the two-level (EstimateWorkspace / DeclareWorkspaceRequirements)
workspace-size estimation pilot for MatMulNBits (issue #29775 Phase-A, PR #29811). The
WorkspaceRequirement struct in include/onnxruntime/core/framework/workspace_requirement.h is
designed to be included by both in-tree kernel code and future plugin-EP adapter code — this is exactly
the kind of dual-included, DLL-boundary-crossing header where these gotchas apply.
1. Never forward-declare Node in a header included from both worlds
Symptom: a compile failure or, worse, a silent type mismatch that depends on include order —
because onnxruntime::Node is not one type across the whole codebase. In-tree code sees class Node
from core/graph/graph.h. Shared-provider/plugin-bridge code (anything reachable from a plugin DLL)
sees a different Node type from a provider-bridge header (e.g. struct Node final). These are two
distinct types that happen to share a name — different "ODR worlds."
The trap: writing class Node; (or any forward-declaration of Node) in a header that might be
#included from both worlds. Whichever world's real definition gets included later in the same
translation unit can clash with your forward-declaration's class-key (class vs struct), or — worse
— the header can compile fine in isolation and only fail (or silently pick the wrong type) once combined
with a specific set of other includes.
The fix: omit the forward-declaration entirely. Don't try to avoid the #include of the real Node
header for compile-time savings in a shared, dual-included header — let each translation unit's own
real includes provide whatever Node type it needs. If you only need a pointer/reference and think a
forward-declare is a safe optimization, it is not safe here specifically because the two worlds disagree
on the underlying type.
How to confirm you're clear: the header must build cleanly when included from an in-tree-only translation unit AND (once such a target exists) from a plugin-DLL translation unit, without relying on which one happens to be included first.
2. Keep the shared/reusable half of a workspace-estimation function free of graph types
When a kernel's workspace-size computation needs to be callable from both in-tree and (eventually) plugin code, split it into two pieces:
- Pure-math core — takes only plain shape/arch integers (e.g.
ComputeFpAIntBGemmWorkspaceSize(int m, int n, int k, int sm, int multiProcessorCount)). NoNode&, noNodeArg, noTensorShapeparsing, no ORT graph types at all. This is the part a future plugin implementation can call verbatim — plugin kernels don't haveNode&access, only the C-ABI shape representation (OrtNode,Node_GetInputShape). - Graph-parsing wrapper — extracts the plain integers from
const Node&/NodeArg/TensorShape(or from the plugin's C-ABI shape accessors). This half is inherently different per build configuration and is NOT reusable across the DLL boundary; it must be reimplemented against whichever shape representation the caller has.
Why this matters concretely: if you accidentally let the pure-math core accept or touch an in-tree graph type (even just to read one field), you've made it impossible to reuse from the plugin path without either (a) linking in-tree graph headers into the plugin DLL (defeats the purpose of a plugin boundary) or (b) duplicating the whole function. Keep the split clean from the start.
How to confirm you're clear: grep the pure-math function's signature and body for any ORT graph type
(Node, NodeArg, TensorShape, GraphViewer, etc.) — it should only ever see plain scalars
(int/int64_t/size_t) and, at most, opaque device-property values already extracted by the caller.
If you find a graph type anywhere in that function, the split has leaked and needs to be pulled apart
before a plugin implementation can reuse it.
Related, not yet built: docs/annotated_partitioning/future_directions_constrained_env.md (Phase A /
plugin-ABI sections) describes the intended plugin-side C ABI surface for DeclareWorkspaceRequirements,
but as of PR #29811 no plugin-side implementation exists yet — see that doc's "Cost of a Real
Plugin-Side Override (Deferred)" note for what's still missing beyond just following this split.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

