Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
341 commits
Select commit Hold shift + click to select a range
af93a67
llm: glm 4.5 air (#15771)
b1tg Apr 22, 2026
09ff3e1
hotfix: add bytes back to llm
geohot Apr 22, 2026
3c8daa9
update test_where_removal (#15872)
chenyuxyz Apr 22, 2026
e9ebd03
update reduce_to_acc index dtype [pr] (#15873)
chenyuxyz Apr 22, 2026
2041945
cuda graph to linear (#15870)
nimlgen Apr 22, 2026
b9e2bc6
simplify bool.cast() != const (#15874)
chenyuxyz Apr 22, 2026
e5891ac
jit: precompile (#15848)
nimlgen Apr 22, 2026
b0dc95a
AMX in arch, better docs (#15871)
sirhcm Apr 22, 2026
684e95e
UOp binary op broadcasts dtype (#15875)
chenyuxyz Apr 23, 2026
1fc4b37
cummax/cummin to mixin (#15877)
chenyuxyz Apr 23, 2026
7c9bc29
Tensor method raise if arg is on different device (#15879)
chenyuxyz Apr 23, 2026
0c3260d
rename VECTORIZE to STACK (#15880)
geohot Apr 23, 2026
d3cbd78
llama: use fused norm mul quantize for w13 (#15878)
wozeparrot Apr 23, 2026
e469618
cleaner cuda graph (#15886)
nimlgen Apr 23, 2026
5cf4ad2
fix resolve param (#15889)
nimlgen Apr 23, 2026
87223f8
logcumsumexp, argmax, argmin, sequential to mixin (#15890)
chenyuxyz Apr 23, 2026
f0dbc68
gather to mixin (#15891)
chenyuxyz Apr 23, 2026
11c1979
interpolate and cross_entropy to mixin (#15895)
chenyuxyz Apr 23, 2026
ee76449
viz/cli: -t default number (#15894)
Qazalin Apr 23, 2026
7745e05
sqtt: update wave end packet names (#15896)
Qazalin Apr 23, 2026
782bc6a
broadcast in ElementwiseMixin.div [pr] (#15897)
chenyuxyz Apr 23, 2026
3072862
metal to linear (#15884)
nimlgen Apr 23, 2026
8cc2c69
fix isclose mixin (#15898)
chenyuxyz Apr 24, 2026
08d9106
scatter_reduce and sparse_categorical_crossentropy to mixin (#15902)
chenyuxyz Apr 24, 2026
c24da99
avg_pool2d, max_pool2d to mixin (#15903)
chenyuxyz Apr 24, 2026
f379b5a
sqtt: match amd's TS_DELTA_SHORT offset (#15901)
Qazalin Apr 24, 2026
aab50d1
llm: dedup MLA cache_v (#15887)
b1tg Apr 24, 2026
9d134a2
llama: fix fakedata timing (#15905)
wozeparrot Apr 24, 2026
cbf4946
usb: multiple gpus and better error messages (#15900)
sirhcm Apr 24, 2026
c0f77c2
hcq graph to linear (#15888)
nimlgen Apr 24, 2026
5eb6413
viz/cli: select kernel events in -s DEV (#15909)
Qazalin Apr 24, 2026
48d7ab2
no uv.lock (#15893)
eitanturok Apr 24, 2026
7a1adfd
update Tensor.allclose to return Tensor (#15904)
chenyuxyz Apr 24, 2026
4010aa4
jit: no jit_cache in graphrunner (#15907)
nimlgen Apr 24, 2026
03a7604
sort argsort topk allclose to mixin (#15910)
chenyuxyz Apr 24, 2026
56a9f1e
remove last jit_cahce (#15911)
nimlgen Apr 24, 2026
f275195
remove linear_to_schedule from tests (#15912)
nimlgen Apr 24, 2026
2f9fdb4
scatter to mixin (#15917)
chenyuxyz Apr 24, 2026
b501ba3
nll_loss to mixin (#15918)
chenyuxyz Apr 24, 2026
d337801
schedule() -> schedule_linear() in tests (batch 1) (#15915)
nimlgen Apr 24, 2026
4b908b6
llama: fused ce loss (#15920)
wozeparrot Apr 25, 2026
57fbaa3
amd: fallback to llvm when comgr is not available (#15914)
sirhcm Apr 25, 2026
8b2826e
nv: fix shader local memory for NAK (#15921)
sirhcm Apr 25, 2026
1fdcb13
webgpu: fix weight lookup in export_model after compile_net key chang…
germiBest Apr 25, 2026
3c8a2db
remove schedule() from tests batch 2 (#15923)
nimlgen Apr 25, 2026
d2ab6ea
remove schedule batch 3 (#15924)
nimlgen Apr 25, 2026
a5e9ea7
remove schedule batch 4 (#15927)
nimlgen Apr 25, 2026
768106a
remove schedule from extra/docs/examples (#15929)
nimlgen Apr 25, 2026
9a23de7
viz/cli: unify profile and rewrites, -s ALL default (#15931)
Qazalin Apr 25, 2026
e0ff6cc
remove old schedule (#15930)
nimlgen Apr 25, 2026
e27444a
remove unused UOp.shard_size [pr] (#15933)
chenyuxyz Apr 25, 2026
bb65235
remove execitem (#15932)
nimlgen Apr 25, 2026
ac3494a
remove some runners (#15934)
nimlgen Apr 25, 2026
e9983e3
remove unused QCOMTextureInfo, QueueType [pr] (#15935)
chenyuxyz Apr 25, 2026
117e9e2
estimates from graph (#15937)
nimlgen Apr 26, 2026
96165ff
validate_with_cpu as rewrite (#15938)
nimlgen Apr 26, 2026
eeb8d5e
viz: small ui changes (#15940)
Qazalin Apr 26, 2026
8c174bd
viz/sqtt: correct exec pipes (#15885)
Qazalin Apr 27, 2026
fe38d6d
_pad_circular and _pad_reflect_replicate to mixin (#15944)
chenyuxyz Apr 27, 2026
4164666
programinfo (#15942)
nimlgen Apr 27, 2026
77f9125
move Tensor.pad to OpMixin (#15946)
chenyuxyz Apr 27, 2026
3f50881
cpu: lowercase arch (#15943)
sirhcm Apr 27, 2026
c58fd85
sqtt: add needs_rocprof decorator (#15947)
Qazalin Apr 27, 2026
890d7be
fix: muon not using device (#15936)
CharlieKerfoot Apr 27, 2026
54f00e1
sqtt: correct rdna4 structs (#15948)
Qazalin Apr 27, 2026
987b6dd
python -m tinygrad.device prints interface info (#15950)
sirhcm Apr 28, 2026
5e861cd
llama: move llama kernels to llama_kernels (#15952)
wozeparrot Apr 28, 2026
b3f0f8d
llama: fix missing label_smoothing arg (#15955)
Qazalin Apr 28, 2026
77965a2
local optimize as rewrite (#15953)
nimlgen Apr 28, 2026
5eb1fd5
cleanup: untrack wait Metal buffers (#15954)
NinoRisteski Apr 28, 2026
b36010c
DGX Spark and Jetson Thor support (#15939)
Kaweees Apr 28, 2026
796fdf9
end has no shape (#15958)
geohot Apr 28, 2026
c4bea54
_threefry_random_bits to mixin (#15959)
chenyuxyz Apr 28, 2026
836af56
some RandMixin cleanup (#15961)
chenyuxyz Apr 28, 2026
e6863a1
autogen: fewer type: ignores (#15956)
sirhcm Apr 29, 2026
ef09071
llama: speed 2 (#15960)
wozeparrot Apr 29, 2026
86621e9
gate f32_to_fp8 renderer (#15964)
Qazalin Apr 29, 2026
30403c1
viz/cli: merge DEBUG=6 and -i (#15966)
Qazalin Apr 29, 2026
fb188c3
UOp.bitcast noop early return (#15968)
chenyuxyz Apr 29, 2026
7787f76
get_runner -> get_runtime (#15967)
nimlgen Apr 29, 2026
b63e0a5
viz/sqtt: move amd decoder to extra, don't import from ops_amd (#15969)
Qazalin Apr 29, 2026
5f441ec
unify reduce + reduce_axis (#15973)
geohot Apr 29, 2026
654e611
_bits_to_rand to mixin (#15972)
chenyuxyz Apr 29, 2026
6b9a455
autogen: better version handling for llvm and libclang (#15975)
sirhcm Apr 29, 2026
7a79c29
DEV visible device filter supports hyphenated syntax (#15971)
sirhcm Apr 29, 2026
a37b605
remove arch from asm kernel class (#15977)
Qazalin Apr 29, 2026
0080489
llama: use env vars (#15978)
wozeparrot Apr 29, 2026
dfd2d07
remove CompiledRunner (#15970)
nimlgen Apr 29, 2026
5591558
viz: fix cfg for emulated amd on the null device (#15976)
Qazalin Apr 29, 2026
c73e667
remove if for precompiled programs (#15980)
nimlgen Apr 29, 2026
d07741f
am: look for firmware in /lib/firmware/amdgpu (#15974)
sirhcm Apr 29, 2026
53a28ba
rand device seed to its own function (#15979)
chenyuxyz Apr 29, 2026
b732489
minor rand cleanups (#15982)
chenyuxyz Apr 30, 2026
46a36a8
small dtype shapes fixups (#15984)
geohot Apr 30, 2026
6f8b10d
remove base Runner (#15986)
nimlgen Apr 30, 2026
0f7e296
fix some indexing edge cases (#15988)
geohot Apr 30, 2026
58b34e7
failing test for llama useless copies (#15989)
Qazalin Apr 30, 2026
11e1a2b
cleaner and faster run_linear (#15987)
nimlgen Apr 30, 2026
e0b09f2
input validation for rand functions (#15990)
chenyuxyz Apr 30, 2026
52c92e1
no replacement multinomial (#15995)
chenyuxyz Apr 30, 2026
eddcd47
am_smi throttle info (#15997)
wozeparrot Apr 30, 2026
45fd7a3
lil_image vectorize (#16000)
geohot Apr 30, 2026
528d35e
llama speed 4 (#15993)
wozeparrot May 1, 2026
d651b4b
SPEC=3 checks the shape (#16001)
geohot May 1, 2026
4506688
split render to render.py (#16002)
geohot May 1, 2026
cee73be
am: ip offsets in autogen (#16003)
sirhcm May 1, 2026
f6d92b5
am: use per pipe reset for gfx11+ (#16006)
nimlgen May 1, 2026
65879fe
metal synchronize regression test (#16008)
Qazalin May 1, 2026
a29dd7b
Revert "cleanup: untrack wait Metal buffers (#15954)" (#16010)
Qazalin May 1, 2026
8b147a9
minimal repro for llama copies 2 (#16011)
Qazalin May 1, 2026
1079441
revoke bus master (#16007)
nimlgen May 1, 2026
782d1ff
Tensor.fmod (#16014)
chenyuxyz May 1, 2026
0bffbc5
onnx fmod uses fmod (#16018)
chenyuxyz May 1, 2026
4a2e1f1
STORE doesn't have ranges anymore (#16019)
geohot May 1, 2026
637bdd5
am: only support CDNA3/4 and RDNA3/4 (#16017)
sirhcm May 2, 2026
7dae9e6
viz: keep VIZ.value = 0 during python shutdown, cleanup launch (#16022)
Qazalin May 2, 2026
d65b8ca
jit: remove *input_list from the graph sources (#16021)
nimlgen May 2, 2026
7daf4b7
viz: split cli test (#16015)
Qazalin May 2, 2026
9717d3a
hotfix: prepend LD_LIBRARY_PATH to DLL posix search dirs (#16023)
mefengl May 2, 2026
419d525
feat: handle multioutput kernel grads (#16028)
wozeparrot May 3, 2026
9684334
viz: fix flops in graph, add null graph tracing (#16024)
Qazalin May 3, 2026
4024d84
runtime/graph: avoid core_id runtimevar merge conflicts (#16026)
bigyoshi51 May 3, 2026
c02e390
viz: encode flops, mem and metadata in json (#16032)
Qazalin May 4, 2026
b1d88eb
viz/cli: aggregate flops in -t (#16031)
Qazalin May 4, 2026
a4fccd2
remove kwargs in UOp.vectorize [pr] (#16034)
chenyuxyz May 4, 2026
1884f67
simplify full_rewrite_to_sink spec (#16035)
geohot May 4, 2026
8e99c4f
fetch checks sha256 (#16037)
sirhcm May 4, 2026
5b4f625
cache buffer_views as well (#16039)
nimlgen May 4, 2026
a357a04
Tensor.div cleanup (#16041)
chenyuxyz May 4, 2026
26406be
amd uses .valid, not index src valid (#16042)
geohot May 5, 2026
1c8cb07
am: autogen asic_regs (#16004)
sirhcm May 5, 2026
d79bf35
viz: add CALL -> codegen link (#16044)
Qazalin May 5, 2026
9c37a0c
Ops.FLOORDIV and Ops.FLOORMOD (#16038)
chenyuxyz May 5, 2026
cee17e0
viz: fix diff color (#16045)
Qazalin May 5, 2026
5fa0016
supports_exec_item -> supports_uop (#16033)
nimlgen May 5, 2026
76ff378
autogen: fewer apt dependencies (#16049)
sirhcm May 5, 2026
34fe37d
use FLOORDIV and FLOORMOD (#16048)
chenyuxyz May 5, 2026
ab6218b
llama mp fixes (#16050)
wozeparrot May 5, 2026
795501e
fix device in null graph events (#16053)
Qazalin May 5, 2026
bd06ea9
am: simplify import_module (#16046)
sirhcm May 5, 2026
869eae6
fix double div rewrites (#16054)
chenyuxyz May 5, 2026
1de14cf
am: autogen soc (#16055)
sirhcm May 6, 2026
aaabe42
relax fold_divmod_general (#16058)
chenyuxyz May 6, 2026
c6ad3d3
better divmod late rewrite (#16061)
chenyuxyz May 6, 2026
af4140f
fix divmod recombine for floordiv (#16062)
chenyuxyz May 6, 2026
d7d32d8
viz/cli: print first uop with DEBUG=6 (#16065)
Qazalin May 6, 2026
ef08530
stronger divmod_recombine (#16066)
chenyuxyz May 6, 2026
8e84317
the renderer part of gate moving from index to load/store (#16064)
geohot May 6, 2026
7b91f7c
nv: look for gsp firmware in /lib/firmware (#16068)
sirhcm May 7, 2026
730fa66
llama speed 6 (#16071)
wozeparrot May 7, 2026
f813a04
viz: pickle path in str (#16073)
Qazalin May 7, 2026
a9a87ad
viz/cli: less flags (#16076)
Qazalin May 7, 2026
516b00e
mod and fmod to mixin (#16077)
chenyuxyz May 7, 2026
072db99
div to mixin (#16078)
chenyuxyz May 7, 2026
2f0aa88
tinygpu: minimal is macos13 for resets (#16075)
nimlgen May 7, 2026
f9083cf
use subactions for benchmark.yml process replay [pr] (#13396)
Qazalin May 7, 2026
4d1a9dc
fix: don't copy precompiled custom kernel outputs (#16084)
wozeparrot May 7, 2026
b796bba
fix valid in indexing tests (#16087)
geohot May 7, 2026
9a6f7f7
nv: look for fmc firmware in /lib/firmware (#16080)
sirhcm May 7, 2026
1d1b726
hotfix: disable flaky framework pytest
geohot May 8, 2026
d11f4d0
fix: don't copy on slice of DP weight (#16089)
wozeparrot May 8, 2026
c106c73
remove the gate from index (#16081)
geohot May 8, 2026
83eaefc
onnx: deduplicate simple proto parsers (#16085)
kimjune01 May 8, 2026
80da8a4
add spec to main tinygrad repo (#16092)
geohot May 8, 2026
7ef901a
llm: moe speedup (#16059)
b1tg May 8, 2026
faabe6a
nv: remaining firmware from /lib/firmware (#16088)
sirhcm May 8, 2026
235044c
Ops.IDIV -> Ops.CDIV, Ops.MOD -> Ops.CMOD (#16093)
chenyuxyz May 8, 2026
0f46c08
div mixin cleanups (#16100)
chenyuxyz May 8, 2026
49b55af
jit: simpler free_intermediates (#16099)
nimlgen May 8, 2026
e658453
minor elementwise cleanups (#16102)
chenyuxyz May 8, 2026
5152ff9
_pad_constant and avg_pool2d cleanups (#16110)
chenyuxyz May 8, 2026
4dd6ad3
gradient: add TRUNC backward (#15925)
Cintu07 May 8, 2026
71a8c0d
fix: trailing space format string (#16005)
CharlieKerfoot May 8, 2026
105b037
cl: image alignment in arch (#16106)
sirhcm May 8, 2026
a7512e0
PYTHON: images have no alignment constraints (by default) (#16115)
sirhcm May 9, 2026
026688f
llama: move to correct dir (#16118)
wozeparrot May 9, 2026
b2a682e
remove _shape check in pm_mops [pr] (#16120)
chenyuxyz May 9, 2026
51c7daf
split viz cli test helpers (#16123)
Qazalin May 10, 2026
39ce780
viz/cli: emit all runs of selected kernel, json fixes (#16124)
Qazalin May 10, 2026
daed602
rename BUFFERIZE to STAGE (#16125)
geohot May 10, 2026
28cb7f1
update readme with contributing guidelines
geohot May 10, 2026
53f9587
add canary
geohot May 10, 2026
2dd8441
viz/cli: schedule renderer (#16101)
Qazalin May 10, 2026
ad97388
get_buf() for Buffer (#16134)
nimlgen May 11, 2026
70c2480
hcq2 to extra (#16126)
nimlgen May 11, 2026
59a8155
fix: add self.device to qr, svd, masked_select intermediates (#16131)
shettysach May 11, 2026
692257d
[pr] match torch rmsnorm (#16122)
jjvraw May 11, 2026
f65e343
spec.py cleanups (#16140)
chenyuxyz May 11, 2026
fc2cc1d
viz: call graph renderer example (#16141)
Qazalin May 11, 2026
fbe8be0
style cleanup to Tensor.qr and svd (#16142)
chenyuxyz May 11, 2026
0b02fb6
Revert "[pr] match torch rmsnorm (#16122)" (#16144)
chenyuxyz May 11, 2026
7ba55ad
nv: autogen regs (#16139)
sirhcm May 11, 2026
2dccd4a
am: autogen pmc (#16143)
sirhcm May 11, 2026
63c1f00
disable test_svd_general again (#16146)
chenyuxyz May 11, 2026
effa263
Torch backend `aten::cat.out` fix (#16121)
VikramRangarajan May 11, 2026
371ab20
clean up image_dot and image_conv2d (#16145)
chenyuxyz May 11, 2026
20f587d
nv: rm _download (#16147)
sirhcm May 11, 2026
039d84f
Revert "onnx: deduplicate simple proto parsers" (#16148)
sirhcm May 12, 2026
3942a80
fix wrong kwargs passed into rands (#16149)
chenyuxyz May 12, 2026
8294d10
Update the spec in spec.py to match the current state (#16132)
geohot May 12, 2026
09fd80f
fix randperm and _multi_like drop requires_grad (#16150)
chenyuxyz May 12, 2026
e9359d9
more llama mp fixes (#16151)
wozeparrot May 12, 2026
c1d125f
llm: add markers to --benchmark (#16153)
Qazalin May 12, 2026
5cd0494
viz: canonicalize ast for schedule to codegen linking (#16154)
Qazalin May 12, 2026
fe39cf1
add Ops.SOURCE test (#16155)
Qazalin May 12, 2026
e572993
time_call (#16152)
nimlgen May 12, 2026
a708542
fix ci spec (#16156)
nimlgen May 12, 2026
e93fb5f
hcq2: remove hcqprogram (#16157)
nimlgen May 12, 2026
f3e3c38
explicit args to Tensor.rand (#16161)
chenyuxyz May 12, 2026
64c81df
add all codegen stages to spec_tensor (#16163)
geohot May 12, 2026
25583f6
fix cumsum dtype for 0d input (#16164)
chenyuxyz May 12, 2026
da3b7e8
atol in test_custom_kernel_multi_output_backward_interacting (#16166)
chenyuxyz May 12, 2026
7c3e3fa
fix empty input for masked_select and nonzero (#16168)
chenyuxyz May 12, 2026
a613bcf
allow after on contiguous in spec (#16169)
wozeparrot May 12, 2026
bdcdf1f
jittable masked_select and nonzero (#16170)
chenyuxyz May 12, 2026
316607f
dsp: don't use docker in ci (#16167)
sirhcm May 12, 2026
3844a31
ci: untangle cuda/ocelot, less apt (#16171)
sirhcm May 12, 2026
c6a82fe
functional qr and svd (#16172)
chenyuxyz May 12, 2026
420a08c
qr to mixin (#16173)
chenyuxyz May 13, 2026
2172363
don't use Tensor indexing in svd (#16174)
chenyuxyz May 13, 2026
69e1f3b
remove vec2 from image in gater (#16165)
geohot May 13, 2026
32138c2
svd to mixin (#16175)
chenyuxyz May 13, 2026
7d0c5ab
ci: ocelot needs nvcc on linux (#16178)
sirhcm May 13, 2026
faf7fb7
update nir renderer for new image style (#16179)
geohot May 13, 2026
f1fdd2c
ci: add IMAGE=1 compile-only tests (#16182)
sirhcm May 13, 2026
38d407f
simplify svd more (#16181)
chenyuxyz May 13, 2026
e97f2c1
llama: only gemm + fa custom kernel (#16180)
wozeparrot May 13, 2026
3c806ff
clean up gguf (#16160)
b1tg May 13, 2026
59c34b9
llm: precise device (#16159)
b1tg May 13, 2026
3f9f6a5
minor image_conv2d cleanup (#16187)
chenyuxyz May 13, 2026
ad1fb7c
hcq2: graph (#16186)
nimlgen May 13, 2026
9a365d9
ci: fix null image tests (#16188)
sirhcm May 13, 2026
88ac2ac
llama: cleanups (#16189)
wozeparrot May 14, 2026
dd9187d
minor hash cleanups (#16190)
chenyuxyz May 14, 2026
1b779a9
add gelu approximate="none" (match pytorch) (#16162)
IntendedConsequence May 14, 2026
f03a7fd
viz/cli: readable uop json (#16195)
Qazalin May 14, 2026
8f81164
better compiler_cpu invalid arch errors (#16194)
sirhcm May 14, 2026
3b8cc31
disable fast idiv by default, it's broken (#16197)
geohot May 14, 2026
62ea737
hcq2: share more with graph (#16196)
nimlgen May 14, 2026
83ec66d
fix a fastdiv edge case (#16199)
geohot May 14, 2026
d4dcd84
aggressive shape check to prepare for broadcasting (#16202)
geohot May 14, 2026
09096ea
test_gradient_through_clone (#16203)
chenyuxyz May 14, 2026
ffa1aac
gradient for STORE/AFTER ala clone (#16205)
chenyuxyz May 15, 2026
b4d267d
llama: only save when small (#16208)
wozeparrot May 15, 2026
891a1ae
onnx: remove dtype_fallback (#15717)
sirhcm May 15, 2026
a75c14f
some setitem tests (#16209)
chenyuxyz May 15, 2026
a612b88
better assert when setitem a refed tensor (#16210)
chenyuxyz May 15, 2026
c7870f1
mesa: suggest curl install tip (#16211)
sirhcm May 15, 2026
409bb0c
requires_grad cannot be None (#16212)
chenyuxyz May 15, 2026
fc78663
Merge branch 'upstream/master' into sync-20260517
sunnyhaibin May 18, 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
  •  
  •  
  •  
40 changes: 32 additions & 8 deletions .github/actions/setup-tinygrad/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ inputs:
description: "Install tinydreno"
required: false
default: 'false'
qemu:
description: "Install qemu"
required: false
default: 'false'
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -129,7 +133,7 @@ runs:

# ******************* apt *******************
- name: Setup apt
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.cuda == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true')
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.ocelot == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true' || inputs.qemu == 'true')
shell: bash
run: |
sudo chown -R $USER:$USER /var/cache/apt/archives
Expand Down Expand Up @@ -161,7 +165,7 @@ runs:
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-20 main" | sudo tee /etc/apt/sources.list.d/llvm.list

- name: Compute Package List + Hash
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.cuda == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true')
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.ocelot == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true' || inputs.qemu == 'true')
id: apt-pkgs
shell: bash
run: |
Expand All @@ -177,10 +181,10 @@ runs:
if [[ "${{ inputs.amd }}" == "true" ]]; then
pkgs+=" hsa-rocr comgr hsa-rocr-dev liburing-dev libibverbs-dev libc6-dev"
fi
# **** CUDA ****
if [[ "${{ inputs.cuda }}" == "true" ]]; then
# **** ocelot (dependencies) ****
if [[ "${{ inputs.ocelot }}" == "true" ]]; then
pkgs+=" git g++ cmake ninja-build llvm-15-dev zlib1g-dev libglew-dev \
flex bison libfl-dev libboost-thread-dev libboost-filesystem-dev nvidia-cuda-toolkit-gcc libzstd-dev"
flex bison libfl-dev libboost-thread-dev libboost-filesystem-dev libzstd-dev"
fi
# **** WebGPU (dependencies for software-based vulkan) ****
if [[ "${{ inputs.webgpu }}" == "true" ]]; then
Expand All @@ -190,25 +194,29 @@ runs:
if [[ "${{ inputs.llvm }}" == "true" ]]; then
pkgs+=" libllvm20 clang-20 lld-20"
fi
# **** QEMU ****
if [[ "${{ inputs.qemu }}" == "true" ]]; then
pkgs+=" qemu-user-static"
fi

echo "pkgs=$pkgs" >> "$GITHUB_OUTPUT"
echo "hash=$(echo -n "$pkgs" | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"

- name: Cache apt (PR)
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.cuda == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true') && github.event_name == 'pull_request'
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.ocelot == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true' || inputs.qemu == 'true') && github.event_name == 'pull_request'
uses: actions/cache/restore@v4
with:
path: /var/cache/apt/archives/
key: ${{ runner.os }}-${{ runner.arch }}-apt-${{ steps.apt-pkgs.outputs.hash }}-${{ env.CACHE_VERSION }}
- name: Cache apt
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.cuda == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true') && github.event_name != 'pull_request'
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.ocelot == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true' || inputs.qemu == 'true') && github.event_name != 'pull_request'
uses: actions/cache@v5
with:
path: /var/cache/apt/archives/
key: ${{ runner.os }}-${{ runner.arch }}-apt-${{ steps.apt-pkgs.outputs.hash }}-${{ env.CACHE_VERSION }}

- name: Run apt Update + Install
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.cuda == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true')
if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.ocelot == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true' || inputs.qemu == 'true')
shell: bash
run: |
sudo apt -qq update || true
Expand Down Expand Up @@ -239,6 +247,17 @@ runs:
jq -r '.assets[] | select(.name == "libamd_comgr.dylib").browser_download_url' | \
sudo xargs curl -fL -o /usr/local/lib/libamd_comgr.dylib

# **** CUDA ****
- name: Install CUDA
if: inputs.cuda == 'true'
shell: bash
run: |
sudo mkdir -p /usr/local/cuda/targets/x86_64-linux
curl -fL https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/linux-x86_64/cuda_nvrtc-linux-x86_64-11.5.119-archive.tar.xz \
| sudo tar -xJ -C /usr/local/cuda/targets/x86_64-linux --strip-components=1
echo /usr/local/cuda/targets/x86_64-linux/lib | sudo tee /etc/ld.so.conf.d/cuda-nvrtc.conf
sudo ldconfig

# **** gpuocelot ****

- name: Install gpuocelot dependencies (MacOS)
Expand Down Expand Up @@ -286,6 +305,11 @@ runs:
if [[ "${{ runner.os }}" == "macOS" ]]; then
sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
CMAKE_ARGS="$CMAKE_ARGS -DBoost_INCLUDE_DIR=$(brew --prefix boost)/include -DBoost_LIBRARY_DIR=$(brew --prefix boost)/lib"
else
curl -fL https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/linux-x86_64/cuda_nvcc-linux-x86_64-11.5.119-archive.tar.xz \
| sudo tar -xJ -C /usr/ --strip-components=1
curl -fL https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/linux-x86_64/cuda_cudart-linux-x86_64-11.5.117-archive.tar.xz \
| sudo tar -xJ -C /usr/ --strip-components=1
fi

cmake .. $CMAKE_ARGS
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/autogen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ jobs:
uses: ./.github/actions/setup-tinygrad
with:
key: 'autogen'
opencl: 'true'
amd: 'true'
cuda: 'true'
llvm: 'true'
webgpu: 'true'
mesa: 'true'
pydeps: 'pyyaml mako'
- name: Install autogen support packages
run: sudo apt-get install -y --no-install-recommends libclang-20-dev llvm-20-dev hip-dev libusb-1.0-0-dev libdrm-dev
Expand All @@ -48,7 +44,8 @@ jobs:
python3 -c "from tinygrad.runtime.autogen import opencl"
python3 -c "from tinygrad.runtime.autogen import cuda, nvrtc, nvjitlink, nv_570, nv_580, nv"
python3 -c "from tinygrad.runtime.autogen import comgr_3, hsa, hip, amd_gpu, sqtt, rocprof, amdgpu_kd, amdgpu_drm"
python3 -c "from tinygrad.runtime.autogen.am import am, pm4_soc15, pm4_nv, sdma_4_0_0, sdma_5_0_0, sdma_6_0_0, smu_v13_0_0, smu_v13_0_6, smu_v13_0_12, smu_v14_0_2"
python3 -c "from tinygrad.runtime.autogen.am import *"
python3 -c "from tinygrad.runtime.autogen.nv_regs import *"
python3 -c "from tinygrad.runtime.autogen import libc, kfd, io_uring, ib, pci, vfio"
python3 -c "from tinygrad.runtime.autogen import llvm"
python3 -c "from tinygrad.runtime.autogen import webgpu"
Expand All @@ -58,6 +55,7 @@ jobs:
python3 -c "from tinygrad.runtime.autogen import avcodec"
python3 -c "from tinygrad.runtime.autogen import llvm_qcom"
python3 -c "from tinygrad.runtime.autogen import mlx5"
python3 -c "from tinygrad.runtime.autogen import ggml_common"
REGEN=1 python3 -c "from tinygrad.runtime.autogen import libclang"
- name: Check for differences
run: |
Expand Down
91 changes: 46 additions & 45 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,40 +51,38 @@ jobs:
- name: openpilot compile3 0.10.1 driving_vision
run: FLOAT16=1 DEV=CL IMAGE=1 python3.11 examples/openpilot/compile3.py https://github.com/commaai/openpilot/raw/720392c9a5b986981fdbed1bb8c47a6c5573a50e/selfdrive/modeld/models/driving_vision.onnx

testframeworkpytest:
name: framework pytest
env:
CI: ""
CAPTURE_PROCESS_REPLAY: "0"
runs-on: [self-hosted, framework]
timeout-minutes: 10
defaults:
run:
shell: bash -e -o pipefail {0}
if: github.repository_owner == 'tinygrad'
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: setup python environment
run: |
rm -rf /tmp/tinygrad_pytest_ci
uv venv /tmp/tinygrad_pytest_ci
source /tmp/tinygrad_pytest_ci/bin/activate
uv pip install .[testing]
- name: setup staging db
run: |
echo "CACHEDB=/tmp/pytest-db-ci.db" >> $GITHUB_ENV
rm -f /tmp/pytest-db-ci*
- name: Run pytest -nauto
run: |
source /tmp/tinygrad_pytest_ci/bin/activate
pytest -nauto --durations=20
# TODO: reenable when not flaky
#testframeworkpytest:
# name: framework pytest
# env:
# CI: ""
# CAPTURE_PROCESS_REPLAY: "0"
# runs-on: [self-hosted, framework]
# timeout-minutes: 10
# defaults:
# run:
# shell: bash -e -o pipefail {0}
# if: github.repository_owner == 'tinygrad'
# steps:
# - name: Checkout Code
# uses: actions/checkout@v6
# - name: setup python environment
# run: |
# rm -rf /tmp/tinygrad_pytest_ci
# uv venv /tmp/tinygrad_pytest_ci
# source /tmp/tinygrad_pytest_ci/bin/activate
# uv pip install .[testing]
# - name: setup staging db
# run: |
# echo "CACHEDB=/tmp/pytest-db-ci.db" >> $GITHUB_ENV
# rm -f /tmp/pytest-db-ci*
# - name: Run pytest -nauto
# run: |
# source /tmp/tinygrad_pytest_ci/bin/activate
# pytest -nauto --durations=20

testmacbenchmark:
name: Mac Benchmark
env:
# since sudo is required for usbgpu on macos, move the cache to a new location, as some of the files are owned by root
PYTHONPYCACHEPREFIX: /tmp/tiny_python_pycache
runs-on: [self-hosted, macOS]
timeout-minutes: 60
defaults:
Expand Down Expand Up @@ -189,12 +187,10 @@ jobs:
path: |
onnx_inference_speed.csv
- name: Run process replay tests
run: cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3.11 process_replay.py
uses: ./.github/actions/process-replay

testusbgpu:
name: UsbGPU Benchmark
env:
PYTHONPYCACHEPREFIX: /tmp/tiny_python_pycache
runs-on: [self-hosted, macOS]
timeout-minutes: 10
defaults:
Expand All @@ -213,12 +209,13 @@ jobs:
run: |
PYTHONPATH=. ./extra/hcq/hcq_smi.py amd kill_pids
PYTHONPATH=. ./extra/hcq/hcq_smi.py nv kill_pids
# since sudo is required for usbgpu on macos, do not write bytecode, as some of the files are owned by root
- name: UsbGPU boot time
run: sudo -E PYTHONPATH=. GMMU=0 DEBUG=2 AM_RESET=1 DEV=USB+AMD time python3.11 test/test_tiny.py TestTiny.test_plus
run: sudo -E PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. GMMU=0 DEBUG=2 AM_RESET=1 DEV=USB+AMD time python3.11 test/test_tiny.py TestTiny.test_plus
- name: UsbGPU tiny tests
run: sudo -E PYTHONPATH=. GMMU=0 DEV=USB+AMD python3.11 test/test_tiny.py
run: sudo -E PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. GMMU=0 DEV=USB+AMD python3.11 test/test_tiny.py
- name: UsbGPU copy speeds
run: sudo -E PYTHONPATH=. GMMU=0 DEV=USB+AMD python3.11 test/external/external_test_usb_asm24.py TestDevCopySpeeds
run: sudo -E PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. GMMU=0 DEV=USB+AMD python3.11 test/external/external_test_usb_asm24.py TestDevCopySpeeds
#- name: UsbGPU openpilot test
# run: sudo -E PYTHONPATH=. GMMU=0 DEV=USB+AMD GRAPH_ONE_KERNEL=1 python3.11 examples/openpilot/compile3.py https://github.com/commaai/openpilot/raw/9118973ed03c1ae1d40cf69a29507ec2cc78efd7/selfdrive/modeld/models/supercombo.onnx
- name: UsbGPU (USB4/TB) install script
Expand Down Expand Up @@ -324,7 +321,7 @@ jobs:
path: |
onnx_inference_speed.csv
- name: Run process replay tests
run: cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3 process_replay.py
uses: ./.github/actions/process-replay

testmorenvidiabenchmark:
name: tinybox green Training Benchmark
Expand Down Expand Up @@ -386,7 +383,7 @@ jobs:
# TODO: remove BERT_LAYERS once scheduler is fast
run: BENCHMARK_LOG=bert_10steps_6gpu DEV=NV CAPTURE_PROCESS_REPLAY=0 DEFAULT_FLOAT=HALF BENCHMARK=10 BS=72 GPUS=6 BERT_LAYERS=2 MODEL=bert python3 examples/mlperf/model_train.py
- name: Run process replay tests
run: cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3 process_replay.py
uses: ./.github/actions/process-replay

testamdbenchmark:
name: tinybox red Benchmark
Expand Down Expand Up @@ -498,7 +495,7 @@ jobs:
- name: Run GPT2 w HALF/BEAM
run: BENCHMARK_LOG=gpt2_half_beam DEV=AMD HALF=1 JITBEAM=2 IGNORE_BEAM_CACHE=1 python3 examples/gpt2.py --count 10 --temperature 0 --timing
- name: Run process replay tests
run: cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3 process_replay.py
uses: ./.github/actions/process-replay

testmoreamdbenchmark:
name: tinybox red Training Benchmark
Expand Down Expand Up @@ -555,7 +552,7 @@ jobs:
#- name: Test full tinyfs load
# run: TINYFS_ENDPOINT=10.0.52.11:6767 PYTHONPATH=. python extra/tinyfs/fetch_file.py --hash d734f5e3be9f1e9d863bfaa4fc6c1ef2 --len 175866113 --dest mapping.json --check
- name: Run process replay tests
run: cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3 process_replay.py
uses: ./.github/actions/process-replay

testmlperfamdbenchmark:
name: tinybox red MLPerf Benchmark
Expand Down Expand Up @@ -601,7 +598,7 @@ jobs:
# TODO: remove BERT_LAYERS once scheduler is fast
run: BENCHMARK_LOG=bert_10steps_6gpu DEV=AMD CAPTURE_PROCESS_REPLAY=0 DEFAULT_FLOAT=HALF BENCHMARK=10 BS=72 GPUS=6 BERT_LAYERS=2 MODEL=bert python3 examples/mlperf/model_train.py
- name: Run process replay tests
run: cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3 process_replay.py
uses: ./.github/actions/process-replay

testqualcommbenchmark:
name: comma Benchmark
Expand All @@ -623,6 +620,8 @@ jobs:
run: test/external/process_replay/reset.py
- name: openpilot compile3 0.11.0 driving_vision
run: BENCHMARK_LOG=openpilot_0_11_0_vision PYTHONPATH="." ASSERT_MIN_STEP_TIME=17 DEV=QCOM FLOAT16=1 IMAGE=1 NOLOCALS=1 taskset -c 4-7 python3 examples/openpilot/compile3.py https://github.com/commaai/openpilot/raw/v0.11.0/selfdrive/modeld/models/driving_vision.onnx
- name: openpilot compile3 0.11.0 driving_vision (from pickle)
run: BENCHMARK_LOG=openpilot_0_11_0_vision_run_pickle RUN_PICKLE=1 PYTHONPATH="." ASSERT_MIN_STEP_TIME=17 DEV=QCOM taskset -c 4-7 python3 examples/openpilot/compile3.py
- name: IR3 openpilot compile3 0.11.0 driving_vision
run: BENCHMARK_LOG=ir3_openpilot_0_11_0_vision PYTHONPATH="." ASSERT_MIN_STEP_TIME=17 DEV=QCOM:IR3 FLOAT16=1 IMAGE=1 NOLOCALS=1 taskset -c 4-7 python3 examples/openpilot/compile3.py https://github.com/commaai/openpilot/raw/v0.11.0/selfdrive/modeld/models/driving_vision.onnx
- name: openpilot compile3 0.11.0 driving_policy
Expand All @@ -646,7 +645,7 @@ jobs:
# benchmark on DSP with NOOPT=1, the devectorizer has issues
PYTHONPATH=. CC=clang-19 DEV=DSP NOOPT=1 CNT=2 DEBUG=2 python3 examples/test_onnx_imagenet.py /tmp/model.quant.onnx
- name: Run process replay tests
run: cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3 process_replay.py
uses: ./.github/actions/process-replay

testcommausbgpubenchmark:
name: UsbGPU Benchmark (comma)
Expand All @@ -668,6 +667,8 @@ jobs:
run: BENCHMARK_LOG=usbgpu_openpilot_0_10_1_vision PYTHONPATH="." GMMU=0 DEV=USB+AMD:LLVM ASSERT_MIN_STEP_TIME=50 python3 examples/openpilot/compile3.py https://github.com/commaai/openpilot/raw/720392c9a5b986981fdbed1bb8c47a6c5573a50e/selfdrive/modeld/models/driving_vision.onnx
- name: openpilot load_pickle 0.10.1 driving_vision
run: BENCHMARK_LOG=usbgpu_openpilot_0_10_1_vision_load_pickle PYTHONPATH="." GMMU=0 DEV=USB+AMD ASSERT_MIN_LOAD_TIME=15 python3 examples/openpilot/load_pickle.py
- name: openpilot run_pickle 0.10.1 driving_vision
run: BENCHMARK_LOG=usbgpu_openpilot_0_10_1_vision_run_pickle RUN_PICKLE=1 PYTHONPATH="." GMMU=0 DEV=USB+AMD ASSERT_MIN_STEP_TIME=50 python3 examples/openpilot/compile3.py

testreddriverbenchmark:
name: AM Benchmark
Expand Down Expand Up @@ -741,7 +742,7 @@ jobs:
DEBUG=2 PYTHONPATH=. REMOTE=127.0.0.1:6482 AM_RESET=1 DEV=PCI+AMD AMD_AQL=1 python3 test/test_tiny.py
pkill -f 'extra/remote/serve.py' || true
- name: Run process replay tests
run: cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3 process_replay.py
uses: ./.github/actions/process-replay

testgreendriverbenchmark:
name: NV Benchmark
Expand Down Expand Up @@ -804,4 +805,4 @@ jobs:
DEBUG=2 PYTHONPATH=. REMOTE=127.0.0.1:6483 DEV=NV python3 test/test_tiny.py
pkill -f 'extra/remote/serve.py' || true
- name: Run process replay tests
run: cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3 process_replay.py
uses: ./.github/actions/process-replay
Loading
Loading