Shape changing bitcast and assert bitcast in disk (#3973)

* Shape changing bitcast

* only support it on disk

* basic test

* more tests

* RuntimeError instead of assert

* create unique temp files

* move tests that use disk to test_disk_tensor

* linter

* remove assert on error messages

* that's RuntimeError now

---------

Co-authored-by: George Hotz <72895+geohot@users.noreply.github.com>
This commit is contained in:
uuuvn
2024-03-29 06:49:10 +02:00
committed by GitHub
parent 793ab0512e
commit 8a40d7d423
6 changed files with 56 additions and 11 deletions

View File

@@ -53,7 +53,7 @@ class DiskRunner(JITRunner):
# TODO: there shouldn't actually be casts here, bitcasts should fold into the load
if ast.src[0].op == UnaryOps.CAST:
top_src = ast.src[0].src[0]
# TODO: assert that this is bitcast
assert ast.src[0].arg[1], "disk only supports bitcasts, not normal casts"
self.new_dtype = ast.src[0].arg[0]
else:
top_src = ast.src[0]