Commit Graph
556 Commits
Author SHA1 Message Date
George HotzandGitHub 2f970a4fc2 all realize 2 (#4527)
* all realize 2

* tests fixup

* fix more tests

* fix openpilot

* fix tests

* unneeded
2024-05-10 22:43:09 -07:00
George HotzandGitHub 347a3acb37 add renderer class (#4524)
* add renderer class

* tests pass

* fix pylint

* fix tensor cores
2024-05-10 21:40:02 -07:00
George HotzandGitHub d438d5698d bring buffer back to device (#4517) 2024-05-10 11:22:31 -07:00
George HotzandGitHub 4eef1ee9bf move renderer into options (#4514)
* move renderer into options

* fix tests

* renders are functions
2024-05-10 10:01:51 -07:00
geohot 7c630a9a53 hotfix: fix llama spacing + fix hcq 2024-05-10 15:10:13 +00:00
George HotzandGitHub 58e7256ce9 restore hcq graph (#4513)
* Reapply "hcq graph (#4380)" (#4512)

This reverts commit 06c1e7498e.

* bring back hcq graph
2024-05-10 07:45:05 -07:00
George HotzandGitHub 06c1e7498e Revert "hcq graph (#4380)" (#4512)
This reverts commit 84a2e2b8c1.
2024-05-10 07:18:09 -07:00
nimlgenandGitHub 84a2e2b8c1 hcq graph (#4380)
* start hcq graph

* hack-fix sync on amd

* nv

* fix nv

* multigrah

* fixes

* temp fix for graph

* this is not needed

* fix

* cleaner

* linetr

* fix none

* faster cuda copy

* faster amd copy

* temp nv fixes

* alloc on gpu

* exp: faster amd

* Revert "exp: faster amd"

This reverts commit 2e4cfd1f7d8a33634c50fb5655cff1b40269d28c.

* revert, unrelated

* not in this pr

* linter
2024-05-10 07:15:12 -07:00
George HotzandGitHub 89e119bc58 move Allocator to buffer.py (#4502)
* move Allocator to buffer.py

* move those to realize

* memory file

* cleanup
2024-05-09 19:45:56 -07:00
George HotzandGitHub 1e843d495e cleaning up search with Program (#4500)
* cleaning up search

* fix tests

* test fix

* minor compiler cleanup
2024-05-09 19:01:53 -07:00
George HotzandGitHub c9e84ed0da refactor to Program class (#4476)
* refactor to Program class

* switch to Program

* fix tests

* smaller diff

* self.p

* more tests

* fix metal test

* tests

* fix openpilot

* move that to linearizer

* p.launchdims
2024-05-09 17:29:07 -07:00
nimlgenandGitHub a2e2ba380c nv tune shmem size (#4495)
* nv tune shmem size

* compare them

* linter

* linter2
2024-05-10 00:35:01 +03:00
nimlgenandGitHub e14d5b6fd7 nv fix oob qmd ptr (#4478)
* nv fix oob qmd ptr

* test kernargs no oob
2024-05-08 23:11:04 +03:00
nimlgenandGitHub a1d350a810 nv timeline semaphores (#4464)
* nv timeline semaphores

* nv hcq fixes
2024-05-07 17:31:19 +03:00
nimlgenandGitHub e3bb85fd0e amd timeline semaphores (#4416)
* amd timeline semaphores

* v2

* fixes

* reset signals

* fix

* rollover test

* small fixes

* linter

* copyin
2024-05-07 11:17:32 +03:00
nimlgenandGitHub a3140c9767 nv boost subdevice (#4456) 2024-05-06 23:05:20 +03:00
nimlgenandGitHub d0b8862dea fix out of resource kernels on nv (#4450)
* fix out of resource kernels on nv

* better comment

* noqa

* noqa 2

* linter
2024-05-06 19:24:20 +03:00
nimlgenandGitHub 113c2f00b9 amd doorbell size is 64bits (#4448)
* amd doorbell size ids 64bits

* add test

* test to pass 32bit boundary is more correct

* no need to round there
2024-05-06 16:59:59 +03:00
George HotzandGitHub 12be536c06 Clang graph (#4424)
* clang graph runner

* render_dtype

* name it ClangGraph

* JIT=2

* JIT=2 goes there

* JIT as context var
2024-05-05 09:54:12 -07:00
George HotzandGitHub cb7289f9c9 remove clang program header (#4422)
* remove clang program header

* proper max

* bools are numbers

* fix compile enet
2024-05-04 08:38:01 -07:00
George HotzandGitHub 9fc4465557 subbuffer support (#4397)
* subbuffer support

* diskbuffer offset

* cuda subbuffer works

* use subbuffer

* more subbuffer tests

* consecutive

* cast

* consec

* offset

* view is a better name

* offset is in nbytes

* fix view + memory planner

* delete unused DiskRunner

* reverse order

* no subbuffers on unrealized consts

* only enabled for disk

* don't reverse memory

* view supported devices

* pickle buffer view

* ring jit

* support extra view inputs in jit

* fix JIT=2 issue

* test copy jit

* p2p isn't an option anymore

* fix dep tracking issue

* fix mypy

* fix pickle

* from_nv is contents now
2024-05-03 18:05:57 -07:00
nimlgenandGitHub ca6c8ae739 factor out resource access logic in multigraph base class (#4385)
* factor out resource access logic in multigraph base class

* hsa fixes

* clean

* linter

* linter 2

* not need this
2024-05-03 00:38:22 +03:00
George HotzandGitHub f635c4d273 fix define global (#4383)
* fix define global

* remove name from DEFINE_GLOBAL

* fix fuzzing

* fix ptx

* fix python
2024-05-01 22:32:56 -04:00
George Hotz 105fbd7925 add 3080 support to NV 2024-05-01 11:17:01 -07:00
George HotzandGitHub 272bea5100 GraphRunner (#4375)
* GraphRunner

* new metal graph

* update hsa for graph runner

* put var_vals back

* move that clear after the capture
2024-05-01 10:27:13 -07:00
nimlgenandGitHub d2f89615b2 remove aql remnants in amd (#4346) 2024-04-30 23:36:02 +03:00
SohaibandGitHub 61c97d5305 refactor ops_gpu ctypes (#4331)
* refactor ops_gpu ctypes

- remove redundant byref as ctypes automatically handles passing `type` as
  `POINTER(type)`
- use walrus operator instead of init_c_var when possible

* clSetKernelArg argtype is POINTER(None)
2024-04-30 01:33:34 +08:00
nimlgenandGitHub 8d1649d8c2 raise error when too many resources requested in nv (#4324) 2024-04-27 23:48:51 +03:00
nimlgenandGitHub 6b8a85939d fix lds size for amd (#4287) 2024-04-24 22:54:42 +03:00
geohot acb32e1766 hotfix: PM4 supports timing 2024-04-24 08:38:59 +00:00
George HotzandGitHub 38f97aa0fe rename rawbufs to bufs in ExecItem (#4274) 2024-04-24 11:27:27 +08:00
George HotzandGitHub 60e3aa5cb1 more docs (#4271)
* more work on docs

* CompilerOptions is dataclass
2024-04-24 10:52:42 +08:00
nimlgenandGitHub f3b4dff7c9 KFDProgram -> AMDProgram (#4268) 2024-04-24 00:29:50 +03:00
George HotzandGitHub 9a95781d51 renamed (#4260) 2024-04-23 09:00:28 +04:00
2ae4f45272 WIP PM4 Support (#4110)
* pm4 kernel launch works

* disable USE_THREAD_DIMENSIONS

* add kernel code

* work on real pm4

* pm4 signal

* same

* gate pm4

* hcq tests pass

* ops passes

* pm4 is closer

* pm4 debug (#4165)

* start debug tests passing

* prg

* smth

* hdp flush

* cleaner 1

* do not need this

* logs not need

* small things

* linter

* remove AQL

* test hcq

* fix tests

* it's subtracting, it shouldn't be -1

* pm4 changes (#4251)

* not need this anymore

* sdma signal with non atomic

---------

Co-authored-by: nimlgen <[email protected]>
2024-04-23 08:31:27 +04:00
e6227bdb15 nv driver (#4044)
* start

* fix err 93

* gpu

* ioctl mappings

* alloc like cuda

* semaphores

* wait for semaphores value

* start ops_nv

* very simple kernels work

* init several gpus

* qmd dumper

* dirty, but most of kernels work

* always all test_ops

* progress, more tests, stable

* test_ops passes, gpt2 works

but wth big fifo, wrap of fifo doesn't work, i think it's something coherency releated

* need better sync

* fix sync

* alloc2

* all tests pass!

* cleanup 1

* cleanup

* multigpu, simple transfer

* fix sync

* correct init

* nv_gpu autogen + sync bug fix

* clean extra/nv_gpu_driver

* p2p

* clean up

* remove old gen

* small fixes

* cleanup

* cleanup 2

* small fixes

* bigger queue size

* cleanups

* wait

* fixed signals for devs

* fix hang + parallel beam

* small fixes

* detect when local memory is big in kernel

* correct assert

* small fixes

* correct tls size est

* one va space

* less lines

* shorter

* save 2 lines

* save some lines

* remove type ignores

---------

Co-authored-by: George Hotz <[email protected]>
2024-04-22 19:50:20 +04:00
Micah ZoltuandGitHub 7bc862767c Improves error message when CUDA module fails to load. (#4243) 2024-04-21 11:10:14 -04:00
George HotzandGitHub b9570d6100 clean up update stats (#4226)
* WIP: clean up update stats

* line savings now

* fix graphs

* fix tests

* tighter prints

* remove extra jit=false

* debug=2 means wait

* that won't update stats

* still wait
2024-04-19 15:41:30 +04:00
nimlgenandGitHub 4ed6b42a8a fix kernargs check in kfd (#4194) 2024-04-17 00:44:50 +03:00
geohot b6e7243bfa hotfix: skip slow pre-commit test 2024-04-16 11:48:43 +04:00
nimlgenandGitHub 24a27a01a9 hotfix: CUDA_P2P works (#4155) 2024-04-12 18:20:12 +03:00
nimlgenandGitHub 5a57b48134 cuda p2p enable when available (#4153) 2024-04-12 16:21:54 +03:00
George HotzandGitHub bbda20c0db CompiledASTRunner -> CompiledRunner (#4148) 2024-04-11 08:49:52 -07:00
George HotzandGitHub b7e281cf10 JitItem -> ExecItem (#4146)
* JitItem -> ExecItem

* execitem in realize

* cleaner

* JITRunner -> Runner
2024-04-11 08:24:57 -07:00
geohot 081dd1573f hotfix: keep CUDA D2D copy behind the CUDA_P2P flag 2024-04-10 21:36:48 +00:00
George HotzandGitHub af5984df43 cudagraph memcpy through host (#4137) 2024-04-10 13:17:17 -07:00
George HotzandGitHub ee457a4b20 no more underlying diskbuffer, that's just the device (#4129) 2024-04-10 08:32:25 -07:00
Felix KuehlingandGitHub 38ae4194a6 Fixes for ops_kfd (#4105)
* kfd_ops: Fix GPU node discovery on NUMA systems

Ignore potentially multiple CPU NUMA nodes and any GPU nodes that are
not accessible because of device cgroups.

Signed-off-by: Felix Kuehling <[email protected]>

* kfd_ops: Format the GFX arch target name correctly

The target version in sysfs properties is a decimal representation with
two digits per component.

The format for LLVM GFX target names is a bit quirky for historical
reasons. It uses one digit for the minor version and stepping. When it
ran out of decimal digits for the stepping on gfx90X it started using
hexadecimal there. But the major version is still decimal and went
double digit in GFX10.

Make sure to parse and format it accordingly for all supported GPUs.

Signed-off-by: Felix Kuehling <[email protected]>

---------

Signed-off-by: Felix Kuehling <[email protected]>
2024-04-09 13:21:21 -07:00
George HotzandGitHub ae849d12d7 numpy device + pickle it (#4120) 2024-04-09 13:19:30 -07:00
7fd12aba85 graph remove input buffer references (#4100)
Co-authored-by: chenyu <[email protected]>
2024-04-08 16:49:16 -04:00