Repository navigation
Add Custom Traffic Pattern benchmark - #263
x41lakazam wants to merge 14 commits into
Conversation
|
👋 Hi x41lakazam! Thank you for contributing to ai-dynamo/nixl. Your PR reviewers will review your contribution then trigger the CI to test your changes. 🚀 |
b96ed65 to
83eae3c
Compare
|
@x41lakazam thanks for the contribution! |
sb17v
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Please check the pre-commit hook failure and fix the formatting errors. Initial comments are included.
| ) | ||
| ) | ||
|
|
||
| self.reg_descs = nixl_agent.get_reg_descs(self.bufs, mem_type=mem_type) |
There was a problem hiding this comment.
Instead of registering all individual sharded chunks, can we check if chunks are contiguous and register the entire region? We could time this part and compare the difference.
There was a problem hiding this comment.
The whole point is to simulate sharded bufs
| ) | ||
|
|
||
| self.reg_descs = nixl_agent.get_reg_descs(self.bufs, mem_type=mem_type) | ||
| self.xfer_descs = nixl_agent.get_xfer_descs(self.bufs, mem_type=mem_type) |
There was a problem hiding this comment.
It will also be better to time this part.
There was a problem hiding this comment.
Isn't this supposed to happen in parallel of the KV computation ?
| def _share_md(self) -> None: | ||
| """Share agent metadata between all ranks. (Need to be run after registering buffers)""" | ||
| md = self.nixl_agent.get_agent_metadata() | ||
| mds = dist_utils.allgather_obj(md) | ||
| for other_rank, metadata in enumerate(mds): | ||
| if other_rank == self.my_rank: | ||
| continue | ||
| self.nixl_agent.add_remote_agent(metadata) |
There was a problem hiding this comment.
@sb17v @aranadive This part takes a really really long time (sometimes 20 mins), is it the good way to do it ?
There was a problem hiding this comment.
@x41lakazam, How many ranks are you using?
The steps look good to me.
Do you have the split time measurement for:
- get_agent_metadata
- allgather
- individual and loop measurement for add_remote_agent
|
@x41lakazam please fix pre-commit issues |
|
Next steps for this PR: New Runner - Run either CTP/KVBench @aranadive will look at creating a new skeleton merge PR. |
|
This is merged with PR #433. |
CTPerftest - Custom Traffic Performance Test Implementation
Overview
Benchmark tool to measure the performance of customizable traffic patterns, where each rank sends a custom message size to every other rank (can be 0).
The purpose of such a benchmark is to simulate asymetric traffic flow, like the KV caches transfers flow in a disaggregated inference system.
Such a pattern is defined using a transfer matrix, i.e a matrix where cell [i.j] defines the size of the message sent by rank i to rank j.
The following benchmarks are available:
The PR also introduce a tool script to generate the matrices that would simulate a flow of KV cache transfer, in
tools/inference_workload_matgen.py.Implementation Details
ct_perftest/sequential_custom_traffic_perftest.pyimplements Sequential CT Perftestct_perftest/utils.pyandct_perftest/dist_utils.pyfor distributed testing supportct_perftest/cli.pyfor test configurationct_perftest/common.pydefines an abstraction for NixlBufferstools/inference_workload_matgen.py- Small script to generate transfer matrices of KV transfers, with very basic computation simulation, the output of this script will be a lot of matrices and ametadata.yamlfile that can be directly fed to Sequential CT Benchmark.Sequential CT Perftest
Reports
Sequential CT Perftest reports the total latency per matrix execution, along with their latency when ran isolated, which can be used to evaluate how good the network react to congestion. The report is both saved as a JSON file (controlled by the
--json-output-pathparameter) and displayed in stdout as:Usage
Tests can be defined using YAML configuration files.
CT Perftest define a single traffic pattern, as well as number of iterations and warmup iterations:
Sequential CT Perftest configuration defines a sequence of traffic patterns:
traffic_patternscan contain multiple elements that run sequentially. SeeTrafficPatternincommon.pyfor default values.Example of a matrix file:
Usage
Install requirements
Optionally, generate matrices using the
inference_workload_matgen.pyscriptpython inference_workload_matgen.py generate \ --num-user-requests 10 \ --num-prefill-nodes 16 \ --num-decode-nodes 16 \ --prefill-tp 8 \ --prefill-pp 1 \ --prefill-cp 1 \ --decode-tp 8 \ --decode-pp 1 \ --decode-cp 1 \ --results-dir $PWD/matrices \ --model llama-405bRun the test using the CLI:
Next Steps
Known Issues
_prepare_tp()method).