Repository navigation
Conversation
… FA) and ggml-org#30804 (chunk graphs)
|
I proposed this a few years ago here #11867. I can run Windows perf numbers later this week due to GTC, unless somebody else can help us with this. In the meantime, my AI flagged testing as a possible area for improvement. Can you build a test which ensures that kernel fusion is respected by your new logic? Also, are there backend tests which we can run with |
|
I did test this across a bench of devices and models - however I don't know what a good test to add to the CI would be as we don't have any existing test suite for checking CUDA graph regressions either. |
…gml-org#25592 merged with master ggml-org#30666
ORippler
left a comment
There was a problem hiding this comment.
- Did we test multi-GPU behavior? AFAIK we enqueue already split subgraphs on GP0 -> GPU1 -> reduce -> repeat so there should be no perf deltas, as we likely we won't be hitting the 512 magic number.
- Should evaluate the magic number 512 from perf perspective, but this can be done in follow-up work. We should smoke-test Windows (x86 & RTX Spark) against perf regressions, but someone from nvidia can do this.
however I don't know what a good test to add to the CI would be as we don't have any existing test suite for checking CUDA graph regressions either.
I feel we should add dedicated fusion tests and separate them out from test-backend-ops (we currently don't enforce that fusion actually happens for the patterns we want to test fusion for for example). As part of a backend-specific operator test-suite we should evaluate cudaGraphs as well (this is beyond the scope of this PR imo)
| size_t num_nodes = 0; | ||
| std::vector<cudaGraphNode_t> nodes; |
There was a problem hiding this comment.
| size_t num_nodes = 0; | |
| std::vector<cudaGraphNode_t> nodes; |
unrelated clean-up we could do
| static int ggml_cuda_graph_chunk_size() { | ||
| static const int chunk_size = [] { | ||
| const char * env = getenv("GGML_CUDA_GRAPH_CHUNK_SIZE"); | ||
| return env != nullptr ? atoi(env) : 512; |
There was a problem hiding this comment.
On what HW/Model/OS config was that magic number determined? Wondering if it makes sense to distinguish between Windows/Linux potentially. Can be a follow-up PR though
|
I tried 128,256,512 and 1024. Multi-GPU has no improvement in my tests. |
|
Perf gains seem to be minor on RTX Spark (it's not much, but it's honest work I guess)
|
Co-authored-by: Oliver Simons <osimons@nvidia.com>
Overview
CUDA graphs scale with the size of the graph. We can amortize this cost by running smaller chunks. This idea was given to by @ORippler. This provides a 1-2% TG speed-up.
Requirements