Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example profiler refCount issue #1559

Open
fishautumn opened this issue Dec 30, 2024 · 1 comment
Open

example profiler refCount issue #1559

fishautumn opened this issue Dec 30, 2024 · 1 comment

Comments

@fishautumn
Copy link

fishautumn commented Dec 30, 2024

1. taskEventBase.refCount:

int refCount; // number of references for this operation

at proxyOp start, it is assigned to 1 rather than increment

__atomic_store_n(&parent->base.refCount, 1, __ATOMIC_RELAXED);

__atomic_store_n(&parent->base.refCount, 1, __ATOMIC_RELAXED);

is it a typo?

2. group.refCount:

int refCount;

it is initialized to 1 at group start:

__atomic_store_n(&event->refCount, 1, __ATOMIC_RELAXED);

and is incremented at coll and p2p task start:
__atomic_fetch_add(&parent->refCount, 1, __ATOMIC_RELAXED);

__atomic_fetch_add(&parent->refCount, 1, __ATOMIC_RELAXED);

it is only decremented in updateEvent() function (invoked at op stop -> updateEvent for task -> updateEvent for group)

if (__atomic_fetch_sub(&event->refCount, 1, __ATOMIC_RELAXED) == 1) {

but is not decremented in group stop event:
if (type == ncclProfileGroup) {

After all tasks are released, the group will have refCount==1, so it cannot get released.

@fishautumn fishautumn changed the title example profiler taskEventBase.refCount typo? example profiler refCount issue Dec 30, 2024
@gcongiu
Copy link
Contributor

gcongiu commented Jan 6, 2025

This is a known issue and is fixed in the next NCCL release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants