[Question]: Why is collApiPoolBase incremented twice for the same event in profiler code?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 5.1k
- Forks
- 1.4k
- Avg merge
- 2h 3m
- Merged PRs (30d)
- 2
Description
Question
In the profiler, collApiPoolBase and p2pApiPoolBase are incremented both in updateEvent() (on finalization) and in exampleProfilerStartEvent() (when reusing a groupApi).
What is the purpose of incrementing them during reuse? Could this lead to double-incrementing the same event’s pool base?
code:nccl/ext-profiler/example/plugin.cc
exampleProfilerStartEvent:
while (!profilerQueueEmpty(&event->collApiEvents)) {
struct collApi *collApiEvent = profilerQueueDequeue(&event->collApiEvents);
resetTaskEvents(collApiEvent, ctx);
__atomic_fetch_add(&ctx->collApiPoolBase, 1, __ATOMIC_RELAXED);
}
updateEvent:
else if (type == ncclProfileCollApi) {
struct collApi* event = (struct collApi*) handle;
if (__atomic_sub_fetch(&event->refCount, 1, __ATOMIC_RELAXED) == 0) {
event->stopTs = gettime() - startTime;
__atomic_fetch_add(&event->ctx->collApiPoolBase, 1, __ATOMIC_RELAXED);
}
updateEvent(event->parent);
return;
}
If I’m misunderstanding the lifecycle, please let me know. Thanks!
Contributor guide
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.
Research direction
Start in nccl/ext-profiler/example/plugin.cc by tracing exampleProfilerStartEvent and updateEvent, including the collApi and p2pApi pool-base updates. Follow the event reuse and finalization lifecycle to determine whether each increment represents a distinct pool slot. Done means documenting the lifecycle and confirming whether the observed increments are intentional or require a change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100