tinygrad/test/unit
Christopher Milan 0aabc1e938
Mesa NIR backend (NAK/LLVMpipe) (#12089)
* nak works

* TestOps::test_add works

* testop has no crashes

* fix bool casts

* fix typo

* add disassemble

* RANGE and locals/regs

* simplify NAKCompiler

* disass cleanup

* cleanup nir codegen

* almost all tests passing

* cleanup notes in extra/

* old notes

* only import nak if NIR=1

* fix new SPECIAL syntax

* fix local/shared memory

* more tests passing

* add DEFINE_VAR support

* llvmpipe kinda works

* diskcache

* some mypy stuff

* lvp passing test_ops.py

* fix imports

* actually fix imports

* remove 'stdout'

* fix llvm import

* fix mypy issues

* nicer errors

* simpler test_dtype skips

* test lvp in CI

* fix github action syntax

* fix more actions typos

* switch to mesa 25.1.0

* diskcache_put

* better generation for lvp nir_options

* b64encode shader blobs

* Revert diskcache changes

This reverts commits 930fa3de8a and 8428c694b3.

* general cleanup

* better error messages

* fix llvm import

* fix windows tests

* link with libm and libgcc_s

* fix some errors

* dont check for 'float4'

* NIR uses pointer arithmetic

* use tinymesa

* bump tinymesa

* bump tinymesa again

* update lvp nir_options

* print nir shader with DEBUG

* simplify LVPCompiler

* more tests

* "gated" STORE

* NAK is cacheable

* more tests

* all tests pass locally for NAK

* test autogen in CI

* autogen deps

* more deps

* fix uop_gc

* fix macos

* mypy

* save 2 lines

* save two more lines

* save 1 line

* save 4 lines

* save more lines

* Revert "save more lines"

This reverts commit dd3a720c5a.

* save more lines

* fix LVP on windows

* refactor

* reorganize some code

* refactor lib_gpu

* move LVP check

* out of order loads

* remove support.mesa

* bump tinymesa version

* simplify LVP jit

* macos

* macos ci

* shell: bash

* testing

* more testing

* compute brew prefix

* stupid typo

* actually fix

* lib

* stdout on macos

* inline gallivm_compile_module

* Revert "inline gallivm_compile_module"

This reverts commit b65983b151.

* elf macos

* semicolon

* inherit from CPULLVMCompiler

* ruff

* disas test

* fix libm linking

* default is fine actually

* arm works

* add elf loader link test

* fix NAK beam

* pylint is too smart by half

---------

Co-authored-by: George Hotz <72895+geohot@users.noreply.github.com>
Co-authored-by: nimlgen <138685161+nimlgen@users.noreply.github.com>
2025-10-15 17:38:33 +08:00
..
__init__.py more test cleanups (#2631) 2023-12-05 16:17:57 -08:00
test_allreduce.py minimal mstack pr to fix allreduce (#10649) 2025-06-05 15:14:53 -07:00
test_attention.py clean up more RANGEIFY flag (#12556) 2025-10-09 03:06:48 -04:00
test_block_reorder.py Move Ops.SPECIAL arg to src (#11918) 2025-09-04 09:31:44 +02:00
test_conv.py relax atol for some tests (#12422) 2025-10-02 05:04:44 -04:00
test_device.py fix up some slow tests that launch python (#12672) 2025-10-14 19:13:55 +08:00
test_disk_cache.py helpers.diskcache_clear (#4436) 2024-05-05 14:19:01 -04:00
test_disk_tensor.py skip test_bf16_disk_write_read on CL=1 (#12256) 2025-09-20 17:11:06 +03:00
test_dtype.py nbytes should raise an exception when size is unlimited (#11928) 2025-09-03 07:06:20 -07:00
test_dtype_spec.py skip test_mean_half_precision_overflow (#12331) 2025-09-29 05:15:04 -04:00
test_elf.py Mesa NIR backend (NAK/LLVMpipe) (#12089) 2025-10-15 17:38:33 +08:00
test_gguf.py fix test_dequantization_mxfp4 (#12123) 2025-09-11 14:22:06 -04:00
test_gradient.py rename lazydata to uop (#10698) 2025-06-08 08:42:22 -07:00
test_graph_rewrite.py add dtypes.index (#12015) 2025-09-06 06:03:44 +02:00
test_hashing.py run some hashing test only on METAL (#12554) 2025-10-09 02:39:49 -04:00
test_helpers.py move get_contraction to helpers [pr] (#12594) 2025-10-10 04:28:57 -04:00
test_indexing.py fix up some slow tests that launch python (#12672) 2025-10-14 19:13:55 +08:00
test_kernelize.py remove trivial use of RANGEIFY flag (#12550) 2025-10-09 02:29:38 -04:00
test_linalg.py fix up some slow tests that launch python (#12672) 2025-10-14 19:13:55 +08:00
test_linearizer_rewrite.py early reduce simplify (#12046) 2025-09-10 21:02:46 +08:00
test_llm_tokenizer.py clean up the LLM tokenizer (#12653) 2025-10-14 14:22:01 +08:00
test_masked_st.py move high level tests to unit (#10760) 2025-06-10 12:55:44 -04:00
test_microbenchmarks.py move files into uop dir (#10399) 2025-05-18 11:38:28 -07:00
test_mnist_dataset.py move high level tests to unit (#10760) 2025-06-10 12:55:44 -04:00
test_pattern_matcher.py if upat returns self, it's none (#10898) 2025-06-20 12:11:19 -07:00
test_rearrange_einops.py move high level tests to unit (#10760) 2025-06-10 12:55:44 -04:00
test_rewrite_bottom_up_gate.py Move Ops.SPECIAL arg to src (#11918) 2025-09-04 09:31:44 +02:00
test_rewrite_map.py Revert "UOp.factor and add chain sorting (#12413)" (#12492) 2025-10-08 03:20:23 +02:00
test_shapetracker.py remove some View add logic [pr] (#12584) 2025-10-10 03:47:56 -04:00
test_shapetracker_math.py remove some View add logic [pr] (#12584) 2025-10-10 03:47:56 -04:00
test_shm_tensor.py remove trivial use of RANGEIFY flag (#12550) 2025-10-09 02:29:38 -04:00
test_simple_schedule.py simple schedule test [pr] (#10853) 2025-06-17 16:19:27 -07:00
test_simplify_valid_idx.py UOp symbolic tests use eval to check against string (#12643) 2025-10-13 14:19:42 +02:00
test_symbolic_failures.py [bounty] Z3 symbolic fuzzer [pr] (#10514) 2025-05-28 16:28:37 -04:00
test_symbolic_shapetracker.py remove some View add logic [pr] (#12584) 2025-10-10 03:47:56 -04:00
test_tar.py accept filename decorator [pr] (#8049) 2024-12-05 11:40:59 +08:00
test_tensor_data.py test_tesnor_data to unit/ (#12013) 2025-09-04 19:58:27 -04:00
test_tensor_io.py tar_extract with Tensors (#7853) 2024-12-04 17:03:19 +08:00
test_tensor_uop_representation.py remove Ops.VIEW and related UOp methods (#12522) 2025-10-08 14:47:02 +03:00
test_tinyfs.py feat: Tensor.{load, store} (#12629) 2025-10-13 08:04:41 -07:00
test_tqdm.py Change rate to int in test_tqdm (#10848) 2025-06-18 08:40:43 -04:00
test_transcendental_helpers.py TRANSCENDENTAL_SUPPORTED_DTYPES->TRANSCENDENTAL_DTYPES (#11752) 2025-08-20 10:29:36 -04:00
test_uop_resolve.py move files into uop dir (#10399) 2025-05-18 11:38:28 -07:00
test_uop_symbolic.py UOp symbolic tests use eval to check against string (#12643) 2025-10-13 14:19:42 +02:00
test_uop_vmin_vmax.py Invalid idx (#12067) 2025-09-12 01:42:02 +02:00
test_upat_compile.py move files into uop dir (#10399) 2025-05-18 11:38:28 -07:00
test_view.py remove some View add logic [pr] (#12584) 2025-10-10 03:47:56 -04:00
test_viz.py cleanup viz server (#12688) 2025-10-15 15:58:36 +08:00
test_winograd.py combine pm_drop_and_clauses (#12660) 2025-10-14 10:09:41 +02:00