SimAI_analytical hangs / becomes extremely slow for tp=2 configs
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 184
- Avg merge
- 13h 4m
- Merged PRs (30d)
- 1
Description
Hi, I ran into a strange performance issue with SimAI_analytical.
Environment
- SimAI commit:
f5efb5a - Ubuntu 24.04.4 LTS
- GCC 13.3.0
- Built with
./scripts/build.sh -c analytical
I'm running a 256-GPU Megatron training workload.
For example:
dp=8, tp=4, pp=8finishes in about 1 seconddp=8, tp=2, pp=16did not finish after 2–3 hours
Other configs with tp >= 4 also finish within a few seconds. So far I only see this behavior with tp=2.
The slow case does not have a larger workload either:
tp=2: 781 workload entries, 776 ALLREDUCE opstp=4: 1421 workload entries, 1416 ALLREDUCE opstp=8: 3085 workload entries, 3080 ALLREDUCE ops
Memory usage stays around 5 MB during the slow run, while one CPU core stays busy.
I traced it to the event loop in:
astra-sim-alibabacloud/astra-sim/network_frontend/analytical/AnaSim.cc
queue<struct CallTask> call_list;
uint64_t tick = 0;
void AnaSim::Run() {
while (!call_list.empty()) {
CallTask calltask = call_list.front();
while (true) {
if (calltask.time != tick) {
tick++;
} else {
break;
}
}
call_list.pop();
calltask.fun_ptr(calltask.fun_arg);
}
}
A couple of things here look suspicious to me:
-
tickis incremented one by one until it reachescalltask.time. If the timestamp is large, this can result in a very large number of iterations. -
call_listis a FIFO queue. If an event withcalltask.time < tickis popped,tick++can no longer reach that value.
I also noticed that Sys::generate_time() takes int cycles:
timespec_t generate_time(int cycles);
I'm not sure if this is related, but some delay values seem to come from 64-bit values.
Has anyone seen this behavior before? Is this expected in the analytical backend?
Thanks for taking a look!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.