13371 Commits

Author SHA1 Message Date
George Hotz
f597ec8d5f Merge branch 'master' into minigen 2026-05-20 11:22:40 -07:00
George Hotz
19535df53c enable broadcasting in _shape (#16285) 2026-05-20 11:21:51 -07:00
chenyu
4dbe6a2ee7 remove _force_unique from Tensor init (#16277) 2026-05-20 14:13:05 -04:00
Christopher Bradford
fe2d8d1ecf filter by base_class in pci_scan_bus on macOS (#16282)
The Linux path of pci_scan_bus reads /sys/bus/pci/devices/.../class and
skips devices whose base class doesn't match. The macOS (IOKit) path
appended every IOPCIDevice unconditionally, so callers that supplied
base_class to narrow down to e.g. display devices would also get the
audio companion function of a multifunction GPU.

Concretely, an NVIDIA RTX Pro 6000 Blackwell exposes:
  10de:2bb1  class 0x030000 (display)
  10de:22e8  class 0x040300 (multimedia audio)

A PROBE for base_class=3 returned both. With the sorted() at the end of
pci_scan_bus, 22e8 (audio) came first, so the NV runtime picked the
audio function as device 0 and stalled on RESIZE_BAR.

This mirrors the Linux filter on line 70 using the existing read_prop
helper.

Co-authored-by: Christopher Bradford <christopher.bradford@joby.aero>
2026-05-20 20:09:35 +03:00
qazal
1e0fffe256 fused ce llama kernel in UOps (#16263)
* work

* using uops

* delete things

* work

* work

* higher level uops

* cleanups
2026-05-20 19:45:28 +09:00
chenyu
e1715b3b92 extent jit const error to deviceless inputs (#16276) 2026-05-20 02:02:45 -04:00
chenyu
170b857da9 clean up deviceless const _buffer (#16274)
process on CPU similar to multi
2026-05-19 22:47:45 -04:00
chenyu
7af7b6703a relax policy ASSERT_MIN_STEP_TIME to 3.2 (#16273) 2026-05-19 22:29:09 -04:00
chenyu
188d7ec15e clone can take device (#16271)
useful to materialize const on a specific device
2026-05-19 21:29:27 -04:00
wozeparrot
361553c0a8 llama: match flat_llama with model_train (#16269) 2026-05-19 17:25:56 -07:00
George Hotz
da7414d6dc fix RUN_PICKLE and test it (#16272)
* add test for openpilot RUN_PICKLE

* fix RUN_PICKLE and test it
2026-05-19 17:00:25 -07:00
George Hotz
55515747b7 Remove Ops.VCONST (#16267)
* start removing vconst

* remove a lot of vconst

* const folding + strict ordering

* update tests

* spec from minigen

* move that
2026-05-19 16:35:24 -07:00
Christopher Milan
7cdd9cbdeb PYTHONREMU: V_CVT_PK_BF8_F32 saturation (#16268) 2026-05-19 19:29:59 -04:00
George Hotz
4524c78e87 broadcast 2026-05-19 15:02:05 -07:00
George Hotz
651031e3da Merge branch 'master' into minigen 2026-05-19 14:12:51 -07:00
Christopher Milan
bb2a51f1ea fix mypy mockgpu and add tinygrad.renderer.isa to packages (#16265) 2026-05-19 16:45:03 -04:00
chenyu
890b731b1e more prerequisuite test changed for deviceless const (#16264) 2026-05-19 15:43:45 -04:00
ttomsa
aa1e59ab97 X86 with Ops.INS (#14873)
* draft

* cleanup test_encodings

* cleanup test_isel

* model flag state and support rematerialization

* woops

* add vbroadcastss instruction

* don't fuse load if used multiple times in src

* add movabs instruction and fix idiv

* fixes

* add x86 backend to tests

* float16 fix

* rm TwoAddress2nd

* add BARRIER

* test windows ci

* yup isel fixes the mask stuff too and its beautiful

* add cmoves to the spec

* support storing imms

* no TUPLE_ORDER, breaks tests

* fix remaining seg faults

* add float max

* always fuse index

* minor

* fix DEFINE_VAR/SPECIAL and enable multithreading

* linter

* more linter

* more

* more

* more

* let's try this

* perhaps

* start new scheduler

* more scheduling info

* cleaner shuffle functions

* fixup isel tests

* skip bounds check when NOOPs exist

* skip inf rewrite tests

* fix const tag hack and add x86ops to _shape

* fix

* skip a few tests

* func arg order independent from op value

* x86 goes in own linearize

* switch to PARAM

* more

* add min x86op and neg in decomps

* do mulacc in isel

* use def_reg in test_encodings

* enable emulated int64 tests

* how much does this fix

* Ops becomes OpType

* fix

* rm noqa

* rm machine scheduler stuff

* and this

* allow for extending enums and move X86Ops out of uop

* fix imports

* rm X86GroupOp from ops.py

* spacing

* tell mypy to shut up

* more linter

* add x86op test

* allow set[X86Ops] in upat

* move NOOPs to pre_isel_matcher and rm NOOP from spec

* more asserts

* also this

* cleanup encode

* simplify live range

* fix idiv

* add Ops.INS to x86

* more changes

* more changes

* more changes

* fix

* fix

* fix

* fix

* print formatted assembly

* fix 8bit idiv?

* oops

* enable float16  and unaligned vector load/store

* actually no

* move x86 tests

* no more bool cast

* fix

* linter

* linter

* move X86Ops to x86.py

* fix vpbroadcast

* cleanups

* linter

* print correct reg names

* canonical max

* move max/min and add test

* support float16 vector load/store

* rm bad rewrite

* vpsrldq can't access memory

* regalloc takes renderer

* enable vector load/store on all dtypes

* more isel tests

* rm this for now

* a lot better

* fix

* fix

* fix

* deal with flags correctly

* fix

* enable gep noop rule

* fix

* fix

* fix

* add callee saved registers

* use Ops.CONST instead of X86Ops.IMM

* fix

* enable TUPLE_ORDER

* fix

* rm x86 code in linearizer

* fix

* fix

* fix

* move isa rewrites to codegen

* fix

* fix

* skip test_linearizer.py

* skip more tests

* fix

* fix for idiv/mod changes

* fix

* don't use fmadd if it duplicates fused op

* hacky

* fix

* cleanups

* cleanups

* fix

---------

Co-authored-by: George Hotz <72895+geohot@users.noreply.github.com>
2026-05-19 12:42:54 -07:00
George Hotz
b2e8102209 25000 lines for x86 backend 2026-05-19 11:27:41 -07:00
Sachith Shetty
74567c1958 fix: pass input device to ONNX helper internal tensors (#16242)
* fix: pass input device to onnx methods internal tensors

* test: onnx helper internal tensors use input device
2026-05-19 11:16:33 -07:00
Christopher Milan
a178301dbe PYTHONREMU: fix CDNA VOP3 conditional writes (#16258) 2026-05-19 13:31:31 -04:00
nimlgen
b3dcf8f452 hcq2: split into schedule/realize (#16216)
* hcq2: split into schedule/realize

* missing

* x

* f

* clean

* cleaner

* x

* x

* x

* x

* x
2026-05-19 16:40:17 +03:00
qazal
e4350e7de9 set hipcc mac docker to 7.1 (#16261)
* set hipcc mac docker to 7.1

* pull from amd
2026-05-19 21:30:39 +09:00
George Hotz
79ad8f3ef4 Merge branch 'master' into minigen 2026-05-18 22:14:50 -07:00
George Hotz
a120709671 tighten shape spec for broadcasting (#16206)
* tighten shape spec for broadcasting

* use IndexError, not ValueError

* needs size
2026-05-18 22:12:04 -07:00
George Hotz
c54151235e expanded 2026-05-18 21:00:57 -07:00
George Hotz
8a25d18135 Merge branch 'master' into minigen 2026-05-18 20:40:14 -07:00
George Hotz
3f2d401464 all tests pass with NOOPT=1 (#16257)
* all tests pass with NOOPT=1

* fix a few more

* noopt 100% pass

* noopt 100% pass
2026-05-18 20:39:51 -07:00
chenyu
e694d7f222 more deviceless const prerequisites [pr] (#16256)
* more deviceless const prerequisites [pr]

* remove that

* arange.contiguous -> arange.clone in tests

arange will become deviceless const soon, update tests where it needs to be a buffer
2026-05-18 23:14:12 -04:00
chenyu
c1076ed56c Tensor.device and UOp.device can be None (#16255) 2026-05-18 22:08:10 -04:00
George Hotz
4e3c3e66b0 fix weakint 2026-05-18 19:06:29 -07:00
George Hotz
474ec6e44d more amd fixes 2026-05-18 18:34:16 -07:00
George Hotz
7274239315 emu fixes 2026-05-18 18:23:10 -07:00
wozeparrot
a3d59faef6 llama: don't save weight (#16252) 2026-05-18 17:05:45 -07:00
qazal
18b102f355 llama: also use 7.1 comgr, update startup_walltime.sh (#16253) 2026-05-19 08:59:02 +09:00
chenyu
d532b4f533 multi alu with deviceless const (#16251) 2026-05-18 19:31:53 -04:00
George Hotz
3378626308 fix custom kernel 2026-05-18 16:12:46 -07:00
qazal
98b8a2b407 llama: use hipcc 7.1 version (#16250) 2026-05-19 08:09:57 +09:00
Christopher Milan
7515824a6d ci: actually use clang-20, enable bfloat16 (#16249) 2026-05-18 19:06:43 -04:00
George Hotz
9e408e239f fix rangeify tests 2026-05-18 15:56:57 -07:00
George Hotz
b7e3b92c54 fix pow 2026-05-18 15:37:26 -07:00
chenyu
754344087a assign for deviceless const source (#16248) 2026-05-18 17:39:53 -04:00
George Hotz
96ad6f05bf Merge branch 'master' into minigen 2026-05-18 14:14:41 -07:00
chenyu
73e6b4963b to and shard is noop for deviceless uop (#16247) 2026-05-18 16:11:10 -04:00
Christopher Milan
50481ec9b4 cl: check for cl_khr_fp64 (#16246) 2026-05-18 14:42:43 -04:00
chenyu
db639ebe3e deviceless const from UOp (#16243) 2026-05-18 14:14:12 -04:00
qazal
bfb2d1f89a Revert "fp8 gemm speedup (#16236)" (#16245)
This reverts commit d95bf394e1.
2026-05-19 02:01:44 +09:00
chenyu
5ae4dbd599 make slow tests faster (#16244) 2026-05-18 11:42:02 -04:00
chenyu
981c12182f remove requires_grad= in tinygrad/ (#16241) 2026-05-17 16:55:37 -04:00
chenyu
fcdd1af880 remove Tensor.detach override [pr] (#16239) 2026-05-16 23:58:12 -04:00