Skip to content

Commit 8b6909d

Browse files
grissom.wangclaude
andcommitted
fix(ci): deterministic size checks — byte sums instead of du
check_counts.py used `du -sh`, whose block-size accounting differs between filesystems: the same tree measured 6.8M/2.9M on macOS (APFS) but 7.0M/3.0M on the Linux runner, failing CI on both PTX and cuBLAS sizes. Sizes are now summed file bytes (identical everywhere); all documented sizes re-baselined to the byte basis (ptx 5.6MB, runtime 892K, driver 1.8MB, math 455K, cublas 2.1MB, nccl 753K) across SKILL.md, search guides, and the integration guide. Co-Authored-By: Claude Code <noreply@anthropic.com>
1 parent 1e19aa9 commit 8b6909d

9 files changed

Lines changed: 44 additions & 38 deletions

File tree

‎nvidia-docs-ai-integration-guide.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@
6767

6868
## 3. 覆盖了哪些文档
6969

70-
转换后的文档覆盖 vLLM 开发最常用的 6 套参考资料,总计约 15 MB、1178 个文件(含搜索指南) :
70+
转换后的文档覆盖 vLLM 开发最常用的 6 套参考资料,总计约 12 MB、1178 个文件(含搜索指南) :
7171

7272
| 文档集 | 文件数 | 大小 | 主要内容 |
7373
| --------------------- | ------ | ------ | ---------------------------------------------- |
74-
| PTX ISA 9.4 | 505 | 6.8 MB | 完整指令集,`wgmma`、`cp.async`、`mbarrier` 等 |
75-
| CUDA Runtime API 13.4 | 101 | 1.2 MB | 38 模块 + 62 数据结构 |
76-
| CUDA Driver API 13.4 | 135 | 2.0 MB | 50 模块(含虚拟内存、 context 管理) |
77-
| CUDA Math API 13.4 | 45 | 548 KB | `half` / `bfloat16` / FP8 内置函数,类型转换 |
78-
| cuBLAS 13.4 | 320 | 2.9 MB | GEMM、`cuBLASLt`、FP8 GEMM、epilogue 融合 |
79-
| NCCL | 61 | 876 KB | API + 使用指南 + 全量环境变量 |
74+
| PTX ISA 9.4 | 505 | 5.6 MB | 完整指令集,`wgmma`、`cp.async`、`mbarrier` 等 |
75+
| CUDA Runtime API 13.4 | 101 | 892 KB | 38 模块 + 62 数据结构 |
76+
| CUDA Driver API 13.4 | 135 | 1.8 MB | 50 模块(含虚拟内存、 context 管理) |
77+
| CUDA Math API 13.4 | 45 | 455 KB | `half` / `bfloat16` / FP8 内置函数,类型转换 |
78+
| cuBLAS 13.4 | 320 | 2.1 MB | GEMM、`cuBLASLt`、FP8 GEMM、epilogue 融合 |
79+
| NCCL | 61 | 753 KB | API + 使用指南 + 全量环境变量 |
8080

8181
文档经过清洗:去掉重复 TOC、导航栏、冗余 URL、版权声明等噪音,**体积压缩 76-83%**,只保留你真正需要的内容。
8282

‎scripts/check_counts.py‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env python3
22
"""Verify documented file counts match actual filesystem.
33
4-
File sizes are documented as `du -sh` (disk usage), which includes filesystem
5-
block overhead. This script compares counts exactly and sizes within tolerance.
4+
File sizes are documented as summed file bytes (deterministic on every
5+
platform). `du -sh` was rejected because its block-size accounting differs
6+
between filesystems — macOS and Linux CI disagreed on the same tree.
7+
Counts are compared exactly and sizes within tolerance.
68
79
Usage: python3 scripts/check_counts.py
810
"""
911

1012
import re
11-
import subprocess
1213
import sys
1314
from pathlib import Path
1415

@@ -38,20 +39,25 @@
3839
}
3940

4041
SKILL_MD_CHECKS = [
41-
("PTX ISA", "ptx-docs", 505, "6.8MB"), ("CUDA Runtime API", "cuda-runtime-docs", 101, "1.2MB"),
42-
("CUDA Driver API", "cuda-driver-docs", 135, "2.0MB"), ("cuBLAS", "cublas-docs", 320, "2.9MB"),
43-
("CUDA Math API", "cuda-math-docs", 45, "548K"), ("NCCL", "nccl-docs", 61, "876K"),
42+
("PTX ISA", "ptx-docs", 505, "5.6MB"), ("CUDA Runtime API", "cuda-runtime-docs", 101, "892K"),
43+
("CUDA Driver API", "cuda-driver-docs", 135, "1.8MB"), ("cuBLAS", "cublas-docs", 320, "2.1MB"),
44+
("CUDA Math API", "cuda-math-docs", 45, "455K"), ("NCCL", "nccl-docs", 61, "753K"),
4445
]
4546

4647

4748
def count_md_files(d: Path) -> int:
4849
return len(list(d.rglob("*.md")))
4950

5051

51-
def du_size_str(d: Path) -> str:
52-
"""Return 'du -sh' style size string, e.g. '2.3M' or '528K'."""
53-
result = subprocess.run(["du", "-sh", str(d)], capture_output=True, text=True)
54-
return result.stdout.split()[0] # e.g. "2.3M" or "528K"
52+
def byte_size_str(d: Path) -> str:
53+
"""Return deterministic size string from summed .md file bytes.
54+
55+
e.g. '5.6M' or '455K' — identical on macOS dev machines and Linux CI.
56+
"""
57+
total = sum(f.stat().st_size for f in d.rglob("*.md"))
58+
if total >= 1024 * 1024:
59+
return f"{total / 1024 / 1024:.1f}M"
60+
return f"{round(total / 1024)}K"
5561

5662

5763
def parse_size(s: str) -> float:
@@ -102,7 +108,7 @@ def main() -> int:
102108
print("\n=== cuda-knowledge/SKILL.md Counts ===")
103109
for api_name, dir_name, expected_files, expected_size in SKILL_MD_CHECKS:
104110
actual_files = count_md_files(REFS_DIR / dir_name)
105-
actual_size = du_size_str(REFS_DIR / dir_name)
111+
actual_size = byte_size_str(REFS_DIR / dir_name)
106112

107113
if actual_files != expected_files:
108114
print(f" ✗ {api_name}: {expected_files} documented, {actual_files} actual files")

‎skills/cuda-knowledge/SKILL.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,22 +216,22 @@ nvcc program.cu -lnvToolsExt -o program
216216

217217
Complete reference documentation available for grep-based search:
218218

219-
**PTX ISA 9.4** — `references/ptx-docs/` (505 files, 6.8MB)
219+
**PTX ISA 9.4** — `references/ptx-docs/` (505 files, 5.6MB)
220220

221221
- Search guide: `references/ptx-isa.md`
222222
- Use for: Instruction-level optimization, inline PTX, TensorCore operations (WMMA, WGMMA, TMA), memory swizzling
223223

224-
**CUDA Runtime API 13.4** — `references/cuda-runtime-docs/` (101 files, 1.2MB)
224+
**CUDA Runtime API 13.4** — `references/cuda-runtime-docs/` (101 files, 892K)
225225

226226
- Search guide: `references/cuda-runtime.md`
227227
- Use for: Error codes, API parameters, device properties (`cudaDeviceProp`), memory management, stream behavior
228228

229-
**CUDA Driver API 13.4** — `references/cuda-driver-docs/` (135 files, 2.0MB)
229+
**CUDA Driver API 13.4** — `references/cuda-driver-docs/` (135 files, 1.8MB)
230230

231231
- Search guide: `references/cuda-driver.md`
232232
- Use for: Context management (`cuCtxCreate`), module loading (`cuModuleLoad`), virtual memory, Driver errors (`CUDA_ERROR_*`), advanced features
233233

234-
**cuBLAS 13.4** — `references/cublas-docs/` (320 files, 2.9MB)
234+
**cuBLAS 13.4** — `references/cublas-docs/` (320 files, 2.1MB)
235235

236236
- Search guide: `references/cublas.md`
237237
- Chapters: `1-introduction/`, `2-using-the-cublas-api/`, `3-using-the-cublaslt-api/`, `4-using-the-cublasxt-api/`
@@ -242,7 +242,7 @@ Complete reference documentation available for grep-based search:
242242
- `3-using-the-cublaslt-api/3.3-cublaslt-datatypes-reference.md` — cublasLtEpilogue_t, layout attributes
243243
- `2-using-the-cublas-api/2.8-blas-like-extension.md` — GemmEx, GemmBatchedEx, GemmStridedBatchedEx
244244

245-
**CUDA Math API** — `references/cuda-math-docs/` (45 files, 548K)
245+
**CUDA Math API** — `references/cuda-math-docs/` (45 files, 455K)
246246

247247
- Search guide: `references/cuda-math.md`
248248
- Modules: `modules/` (14 files) — single/double precision, intrinsics for half, bfloat16, FP8, FP6, FP4, SIMD, cast, integer
@@ -254,7 +254,7 @@ Complete reference documentation available for grep-based search:
254254
- `modules/group__cuda__math__intrinsic__half.md` — `__half` arithmetic operations
255255
- `modules/group__cuda__math__intrinsic__bfloat16.md` — `__nv_bfloat16` operations
256256

257-
**NCCL** — `references/nccl-docs/` (61 files, 876K)
257+
**NCCL** — `references/nccl-docs/` (61 files, 753K)
258258

259259
- Search guide: `references/nccl.md`
260260
- Structure: `usage/` (12 files — communicators, collectives, streams, P2P, CUDA graphs), `api/` (14 files — colls, comms, p2p, types, device API), `nccl4py/` (16 files — Python bindings), `troubleshooting/` (7 files), top-level guides (overview, env, examples, mpi)

‎skills/cuda-knowledge/references/cublas.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Table of Contents
66

7-
- [Local Documentation](#local-documentation) — 320 markdown files, 2.9MB
7+
- [Local Documentation](#local-documentation) — 320 markdown files, 2.1MB
88
- [When to Use cuBLAS Documentation](#when-to-use-cublas-documentation) — GEMM, batched ops, cuBLASLt, FP8
99
- [Quick Search Examples](#quick-search-examples) — GEMM, epilogues, compute types, FP8
1010
- [cuBLAS vs cuBLASLt vs cuBLASXt](#cublas-vs-cublaslt-vs-cublasxt) — Which API to use
@@ -21,7 +21,7 @@
2121
The documentation has been converted to markdown with:
2222

2323
- ✅ All function signatures, parameters, and return values preserved
24-
- ✅ 320 files organized by chapter (2.9 MB)
24+
- ✅ 320 files organized by chapter (2.1 MB)
2525
- ✅ Full searchability with grep/ripgrep
2626
- ✅ Type, enum, and function names preserved (redundant URLs removed)
2727
- ✅ Detailed descriptions, notes, and caveats

‎skills/cuda-knowledge/references/cuda-driver.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Table of Contents
66

7-
- [Local Documentation](#local-documentation) — 135 markdown files, 2.0MB
7+
- [Local Documentation](#local-documentation) — 135 markdown files, 1.8MB
88
- [When to Use CUDA Driver API Documentation](#when-to-use-cuda-driver-api-documentation) — Context management, module loading, virtual memory
99
- [Quick Search Examples](#quick-search-examples) — Error codes, contexts, module loading, virtual memory
1010
- [Driver API vs Runtime API](#driver-api-vs-runtime-api) — Key differences and when to use each
@@ -21,7 +21,7 @@
2121
The documentation has been converted to markdown with:
2222

2323
- ✅ All function signatures, parameters, and return values preserved
24-
- ✅ 135 files organized by module and data structures (2.0 MB)
24+
- ✅ 135 files organized by module and data structures (1.8 MB)
2525
- ✅ Full searchability with grep/ripgrep
2626
- ✅ Type and function names preserved (redundant URLs removed)
2727
- ✅ Detailed descriptions and notes
@@ -255,6 +255,6 @@ grep "cuGraphLaunch" cuda-driver-docs/modules/group__cuda__graph.md
255255

256256
- **CUDA Toolkit Version**: 13.4
257257
- **Documentation Date**: September 14, 2026
258-
- **Total Size**: 2.0 MB (73% reduction from 6.8 MB raw)
258+
- **Total Size**: 1.8 MB (73% reduction from 6.5 MB raw)
259259
- **Files**: 50 modules + 84 data structures + 1 index
260260
- **Source**: https://docs.nvidia.com/cuda/cuda-driver-api/

‎skills/cuda-knowledge/references/cuda-math.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Table of Contents
66

7-
- [Local Documentation](#local-documentation) — 45 markdown files, 548 KB
7+
- [Local Documentation](#local-documentation) — 45 markdown files, 455 KB
88
- [When to Use CUDA Math API Documentation](#when-to-use-cuda-math-api-documentation) — Device intrinsics, narrow-precision types, casting
99
- [Quick Search Examples](#quick-search-examples) — Fast intrinsics, FP8, half, bfloat16, SIMD
1010
- [Precision Hierarchy](#precision-hierarchy) — Standard vs intrinsic functions
@@ -20,10 +20,10 @@
2020
The documentation has been converted to markdown with:
2121

2222
- ✅ All device function signatures and descriptions preserved
23-
- ✅ 45 files: 14 modules + 30 data structures (548 KB)
23+
- ✅ 45 files: 14 modules + 30 data structures (455 KB)
2424
- ✅ Full searchability with grep/ripgrep
2525
- ✅ Type layouts and bit-field definitions preserved
26-
- ✅ Navigation, duplicate TOC, and footer removed (22% size reduction)
26+
- ✅ Navigation, duplicate TOC, and footer removed (27% size reduction)
2727

2828
**Note:** All functions are `__device__` unless noted. For `__host__ __device__` variants see Standard C math.
2929

@@ -239,6 +239,6 @@ grep "^__device__.*unsigned int\|vadd\|vmax\|vsub" cuda-math-docs/modules/group_
239239
## Version Information
240240

241241
- **CUDA Math API Version**: 13.4
242-
- **Total Size**: 548 KB (22% reduction from 704K raw)
242+
- **Total Size**: 455 KB (27% reduction from 617K raw)
243243
- **Files**: 14 modules + 30 data structures + 1 index
244244
- **Source**: https://docs.nvidia.com/cuda/cuda-math-api/

‎skills/cuda-knowledge/references/cuda-runtime.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Table of Contents
66

7-
- [Local Documentation](#local-documentation) — 101 markdown files, 1.2MB
7+
- [Local Documentation](#local-documentation) — 101 markdown files, 892 KB
88
- [When to Use CUDA Runtime Documentation](#when-to-use-cuda-runtime-documentation) — Error codes, API details, device properties
99
- [Quick Search Examples](#quick-search-examples) — Error codes, cudaDeviceProp, contexts, streams, memory pools
1010
- [Documentation Structure](#documentation-structure) — Modules and data structures organization
@@ -22,7 +22,7 @@
2222
The documentation has been converted to markdown with:
2323

2424
- ✅ All function signatures, parameters, and return values preserved
25-
- ✅ 101 files organized by module and data structures (1.2 MB)
25+
- ✅ 101 files organized by module and data structures (892K)
2626
- ✅ Full searchability with grep/ripgrep
2727
- ✅ Type and function names preserved (redundant URLs removed)
2828
- ✅ Detailed descriptions and notes

‎skills/cuda-knowledge/references/nccl.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Table of Contents
66

7-
- [Local Documentation](#local-documentation) — 61 markdown files, 876 KB
7+
- [Local Documentation](#local-documentation) — 61 markdown files, 753 KB
88
- [When to Use NCCL Documentation](#when-to-use-nccl-documentation) — Collectives, P2P, multi-GPU, multi-node
99
- [Quick Search Examples](#quick-search-examples) — AllReduce, comm creation, env vars, errors
1010
- [Key API Functions](#key-api-functions) — Communicators, collectives, P2P
@@ -21,7 +21,7 @@
2121
The documentation has been converted to markdown with:
2222

2323
- ✅ All function signatures, parameters, and return values preserved
24-
- ✅ 61 files organized by topic (876 KB)
24+
- ✅ 61 files organized by topic (753 KB)
2525
- ✅ Full searchability with grep/ripgrep
2626
- ✅ Environment variable reference
2727
- ✅ Usage guide + API reference + troubleshooting sections

‎skills/cuda-knowledge/references/ptx-isa.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Table of Contents
66

7-
- [Local Documentation](#local-documentation) — 505 markdown files, 6.8MB
7+
- [Local Documentation](#local-documentation) — 505 markdown files, 5.6MB
88
- [When to Use PTX Documentation](#when-to-use-ptx-documentation) — Inspecting code, inline PTX, TensorCore ops
99
- [Quick Search Examples](#quick-search-examples) — WGMMA fragments, TMA swizzling, specific instructions
1010
- [Documentation Structure](#documentation-structure) — Chapter organization

0 commit comments

Comments
 (0)