Commit Graph
470 Commits
Author SHA1 Message Date
chenyuandGitHub 13c381b0c0 remove pm_fold_cast_const from initial symbolic [pr] (#17535)
interestingly it gives more accurate numerics when composing const like log10
2026-08-14 14:14:40 -04:00
chenyuandGitHub 80169c6758 remove where push cast to branches from sym [pr] (#17533)
* remove where push cast to branches from sym [pr]

not really needed and one less place that generates casted weak const when it's not needed

* fix
2026-08-14 12:57:56 -04:00
George HotzandGitHub b1859805b1 remove Ops.BIND (#17511)
* remove Ops.BIND

* param arg

* simplify that

* simplify

* cleaner

* props, not functions

* param and buffer can share
2026-08-13 23:52:16 -07:00
RaineandGitHub de04781b36 simplify equivalent const max (#17505)
* add const max folds

* add regression test

* move
2026-08-12 08:39:29 -07:00
sirhcmandGitHub 479ffb0cda remove Ops.SLICE (#17492) 2026-08-11 18:50:04 -04:00
George HotzandGitHub d4d537c8ae add SPEC checking for the kernel graph (#17432)
Unit Tests / Null Tests (pull_request) Failing after 22s
Unit Tests / Unit Tests (pull_request) Failing after 22s
Unit Tests / Docs (pull_request) Failing after 34s
Unit Tests / Fuzzing (pull_request) Failing after 26s
Unit Tests / Torch Backend Tests (pull_request) Failing after 57s
Unit Tests / CL IMAGE Tests (pull_request) Failing after 42s
Unit Tests / Test LLM (pull_request) Failing after 12s
Unit Tests / openpilot Compile Tests (pull_request) Failing after 48s
Unit Tests / Linters (pull_request) Failing after 1m29s
Unit Tests / Optimization Tests (pull_request) Failing after 52s
Unit Tests / Linux (DEV=CL) (pull_request) Failing after 42s
Unit Tests / Linux (DSP) (pull_request) Successful in 1m46s
Unit Tests / Python Backend (pull_request) Failing after 3m11s
Unit Tests / Linux (DEV=CPU:X86) (pull_request) Failing after 24s
Unit Tests / SPEC=2 (2) (pull_request) Successful in 3m53s
Unit Tests / SPEC=2 (1) (pull_request) Successful in 4m4s
Unit Tests / Linux (am) (pull_request) Canceled after 0s
Unit Tests / Linux (amd gfx1100) (pull_request) Canceled after 0s
Unit Tests / Linux (amdllvm gfx1100) (pull_request) Canceled after 0s
Unit Tests / Linux (amd gfx1201) (pull_request) Canceled after 0s
Unit Tests / Linux (amdllvm gfx1201) (pull_request) Canceled after 0s
Unit Tests / Linux (amd gfx950) (pull_request) Canceled after 0s
Unit Tests / Linux (amdllvm gfx950) (pull_request) Canceled after 0s
Unit Tests / Linux (nv) (pull_request) Canceled after 0s
Unit Tests / Linux (ptx) (pull_request) Canceled after 0s
Unit Tests / MacOS (unit) (pull_request) Canceled after 0s
Unit Tests / MacOS (unit, mock) (pull_request) Canceled after 0s
Unit Tests / MacOS (DEV=METAL) (1) (pull_request) Canceled after 0s
Unit Tests / MacOS (DEV=METAL) (2) (pull_request) Canceled after 0s
Unit Tests / MacOS (DEV=CPU:CLANG) (pull_request) Canceled after 0s
Unit Tests / MacOS (DEV=CPU:LLVM) (pull_request) Canceled after 0s
Unit Tests / MacOS (DEV=CPU:LVP) (pull_request) Canceled after 0s
Unit Tests / MacOS (DEV=WEBGPU) (pull_request) Canceled after 0s
Unit Tests / Windows (DEV=CPU:CLANG) (pull_request) Canceled after 0s
Unit Tests / Windows (DEV=CPU:LLVM) (pull_request) Canceled after 0s
Unit Tests / Windows (DEV=CPU:X86) (pull_request) Canceled after 0s
Unit Tests / Windows (DEV=WEBGPU) (pull_request) Canceled after 0s
Unit Tests / Compile-only (ir3) (pull_request) Canceled after 0s
Unit Tests / Compile-only (nak) (pull_request) Canceled after 0s
Unit Tests / Compile-only (QCOM CL) (pull_request) Canceled after 0s
Check Line Counts / Check PR Branch status (pull_request_target) Canceled after 0s
Check Line Counts / Core Library Line Difference (pull_request_target) Canceled after 0s
Unit Tests / Linux (DEV=CPU:LVP) (pull_request) Canceled after 1m10s
Unit Tests / Models (pull_request) Canceled after 3m4s
Unit Tests / hcq2 (pull_request) Canceled after 17s
Unit Tests / AMD ASM IDE (pull_request) Canceled after 28s
Unit Tests / Linux (DEV=CPU:CLANG) (pull_request) Canceled after 2m35s
Unit Tests / Linux (DEV=WEBGPU) (pull_request) Canceled after 51s
Unit Tests / Linux (DEV=CPU:LLVM) (pull_request) Canceled after 2m17s
Unit Tests / ONNX (CPU) Tests (pull_request) Canceled after 3m46s
* add SPEC checking for the kernel graph

* skip test

* raise there, not None

* handwritten

* issue with unshard

* multi works

* and bitcast

* fix new tests

* fix linear

* remove call index

* fix shrink

* fixes
2026-08-08 10:00:06 -07:00
chenyuandGitHub 4a3b8f6501 better _drop_valid_stmts [pr] (#17454) 2026-08-07 15:18:35 -04:00
chenyuandGitHub f76422b8af fix cast to float _min_max [pr] (#17451) 2026-08-07 11:56:19 -04:00
chenyuandGitHub 9020a88f03 truncate float in DType.const [pr] (#17439) 2026-08-06 20:19:08 -04:00
chenyuandGitHub 28e6ef6937 fix postopt symbolic [pr] (#17433)
REDUCE with src simplied to const would become unparented
2026-08-06 00:12:30 -04:00
chenyuandGitHub 7a9cd8e329 move weak function and pm to uop/weak [PR] (#17429) 2026-08-05 22:27:40 -04:00
chenyuandGitHub d726e5f7f3 split pm_fold_cast_const [PR] (#17425)
need to delete this rule that writes strong typed CONST
2026-08-05 19:56:04 -04:00
George HotzandGitHub 581bfdd94f merge track_rewrites and profile_matches into rewrite_group [PR] (#17420)
* merge track_rewrites and profile_matches into rewrite_group

* bug

* flip ctx polarity
2026-08-05 14:41:38 -07:00
George HotzandGitHub 46f0003776 more KernelCountException (#17407) 2026-08-04 22:55:38 -07:00
chenyuandGitHub 9b508dfafc remove invalid special case in cast [PR] (#17405) 2026-08-04 23:08:07 -04:00
George HotzandGitHub e1f42681fa add new schedule tests + format better (#17402)
* add new schedule tests + format better

* assert_kernel_count
2026-08-04 18:46:38 -07:00
George HotzandGitHub 6122b3c98f use check_schedule in tests where possible (#17400) 2026-08-04 18:17:29 -07:00
chenyuandGitHub c1a10e0726 fix _min_max for CAST from float to int [pr] (#17396)
* fix _min_max for CAST from float to int [pr]

* fix
2026-08-04 18:06:50 -04:00
George HotzandGitHub c2625c78cb scalar ALU index fix + llm: preserve_thinking (#17381)
* cstyle: scalar ALU index fix, serve: preserve_thinking, test: fix Handler import

- cstyle.py: return scalar directly when ALU buffer has 1 element
- cli.py: add preserve_thinking param to FallbackTemplate.render
- serve.py: pass preserve_thinking=True when rendering chat completions
- test_llm_server.py: fix import to use Handler from llm.serve

* real fix
2026-08-03 15:10:21 -07:00
George HotzandGitHub 05bc7c6994 fix llm reasoning and Linear import (#17372) 2026-08-02 12:31:52 -07:00
chenyuandGitHub 59df317b12 use UOp.const to create new consts [PR] (#17368)
replace arg won't work with ConstArg
2026-08-02 13:31:55 -04:00
chenyuandGitHub 8e524ca467 CONST related cleanups [pr] (#17352)
ConstFloat(nan) != nan should be False, and some Invalid bool cleanups
2026-08-01 09:54:28 -04:00
chenyuandGitHub 6c0ec39279 UOp.is_invalid [PR] (#17351)
helper to prep ConstArg
2026-08-01 02:36:32 -04:00
chenyuandGitHub b502fc1367 more const arg -> val (#17350) 2026-08-01 02:18:10 -04:00
chenyuandGitHub 850989115d __int__ and __float__ work for weak (#17342) 2026-07-31 19:56:37 -04:00
chenyuandGitHub 277433259e fix sym_infer for CAST (#17338) 2026-07-31 14:38:38 -04:00
chenyuandGitHub ad24750487 const(value, dtype) -> const(value).cast(dtype) in tests (#17335) 2026-07-31 13:24:31 -04:00
chenyuandGitHub 7f4dbb8090 remove shape= from UOp.const [PR] (#17331)
inlined to const_like
2026-07-31 11:18:59 -04:00
chenyuandGitHub 8e2f175542 const(dtype, b) -> const(b, dtype) [PR] (#17328)
prep for dtype removal
2026-07-31 09:46:37 -04:00
nimlgenandGitHub 0c4bfaeb48 coalesce ints (#17323)
* merge ints

* fix z3 validation of coalesced loads

* fix uint vector names in CUDA and Metal
2026-07-31 15:49:56 +03:00
chenyuandGitHub fe8ece7efa fix weak for image gate fusion [pr] (#17310) 2026-07-30 19:47:47 -04:00
chenyuandGitHub ce500c1946 broadcast doesn't cast CONST [pr] (#17308)
* broadcast doesn't cast CONST [pr]

it might change arg from python int to python float, but not cast the CONST, so we don't need or_casted in symbolic. we lower the weak dtype right before decomp

* fix
2026-07-30 18:51:59 -04:00
chenyuandGitHub d52ef3077c fix do_devectorize dtype (#17295)
each one derives its dtype from src, not shared
2026-07-29 23:04:25 -04:00
chenyuandGitHub fd912b348c generic c0*x<c1 [pr] (#17291) 2026-07-29 18:45:23 -04:00
chenyuandGitHub 027907a544 fix c0*x<c1 symbolic [pr] (#17290)
use `//` and not math.ceil
2026-07-29 18:32:31 -04:00
George HotzandGitHub 52c9e5a99e rename LOOP -> WEAK and STRONGLOOP -> LOOP (#17283) 2026-07-29 10:38:36 -07:00
qazalandGitHub e684fcc689 pm_reduce_collapse fix for re enabling stack for cat of same shape (codex) (#17251)
* change

* stack cat

* remove nop

* change
2026-07-29 14:47:28 +09:00
George HotzandGitHub 57ae1bc7a7 rename MULTI to UNSHARD (#17267)
* rename MULTI to UNSHARD

* comment updates (glm)

* rename method to unshard
2026-07-28 16:51:41 -07:00
chenyuandGitHub 23e9e76e8c DEFAULT_FLOAT/DEFAULT_INT ContextVar [pr] (#17265) 2026-07-28 19:08:18 -04:00
chenyuandGitHub fde3a8faff CAPTURE_PROCESS_REPLAY=0 default chaging test [PR] (#17261)
* CAPTURE_PROCESS_REPLAY=0 default chaging test [PR]

quick patch before making default dtype context vars, which is quite annoying

* few more
2026-07-28 17:32:35 -04:00
qazalandGitHub 05e4727feb arange stack regression test (#17250)
* simple failing test

* commend out stack

* a little smaller

* work
2026-07-28 20:00:22 +09:00
b1tgandGitHub bdbb1d702f fix shard axis through symbolic reshape (#17238)
* fix shard axis through symbolic reshape

* bind
2026-07-27 11:32:15 -04:00
chenyuandGitHub 818a892ebc flip from_py to use weak dtypes [pr] (#17229) 2026-07-27 10:07:00 -04:00
chenyuandGitHub 456b5b5060 fix python_alu inf (#17227) 2026-07-26 20:04:12 -04:00
chenyuandGitHub 74c2121d99 promo (uint64, int) -> weakfloat like JAX [pr] (#17204) 2026-07-25 15:20:42 -04:00
chenyuandGitHub ee2ccb1f24 put weakint in dtypes.weaks [pr] (#17202)
* put weakint in dtypes.weaks [pr]

* custom_add_var
2026-07-25 14:00:34 -04:00
chenyuandGitHub 0a6125e571 Invalid is bool, put weakint in promo lattice [pr] (#17188) 2026-07-25 00:06:53 -04:00
George HotzandGitHub 08eceb0ad9 llm: fix generated tokens in usage accounting (#17174) 2026-07-23 21:38:07 -07:00
chenyuandGitHub 1b616669d2 few more symbolic rules [pr] (#17161)
bitcast twice can skip middle one; bool != False is self; two more where combine
2026-07-23 18:05:32 -04:00
sirhcmandGitHub 6ee16eb1fa split out LLVM compilers (#17160) 2026-07-23 17:45:23 -04:00