Skip to content

Add ACTIVITIES_DISABLE_EXTERNAL_CORRELATION to Kineto OD config#1245

Open
ryanzhang22 wants to merge 1 commit intopytorch:mainfrom
ryanzhang22:export-D91512438
Open

Add ACTIVITIES_DISABLE_EXTERNAL_CORRELATION to Kineto OD config#1245
ryanzhang22 wants to merge 1 commit intopytorch:mainfrom
ryanzhang22:export-D91512438

Conversation

@ryanzhang22
Copy link

Summary:
This option is currently supported in Auto-trace under experimental_config -> disable_external_correlation. In this diff, we add support for this in the OD flow by popping EXTERNAL_CORRELATION from the activity types list if it's set to True.

In the auto-trace flow, if disable_external_correlation is True, there is logic to stop pushing/popping correlation ids on function enter/exit. However we don't currently explicitly remove this activity type. To align with OD logic introduced in the diff, in kineto_shim.cpp I also start popping EXTERNAL_CORRELATION from the activity type list. This should(?) be a no-op, because if EXTERNAL_CORRELATION is not in the activity list, then externalCorrelationEnable_=False in (x)ActivityApi and we will also not push/pop correlation IDs. The logic is the same, just in a different layer.

Differential Revision: D91512438

@meta-cla meta-cla bot added the cla signed label Feb 3, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 3, 2026

@ryanzhang22 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D91512438.

…rch#1245)

Summary:

This option is currently supported in Auto-trace under experimental_config -> disable_external_correlation. In this diff, we add support for this in the OD flow by popping EXTERNAL_CORRELATION from the activity types list if it's set to True.

In the auto-trace flow, if disable_external_correlation is True, there is logic to stop pushing/popping correlation ids on [function enter/exit](https://www.internalfb.com/code/fbsource/[062f9c6489e6]/fbcode/caffe2/torch/csrc/profiler/collection.cpp?lines=346). However we don't currently explicitly remove this activity type. To align with OD logic introduced in the diff, in kineto_shim.cpp I also start popping EXTERNAL_CORRELATION from the activity type list. This should(?) be a no-op, because if EXTERNAL_CORRELATION is not in the activity list, then `externalCorrelationEnable_=False` in (x)ActivityApi and we will also not [push/pop correlation IDs](https://www.internalfb.com/code/fbsource/[51042021f958]/fbcode/kineto/libkineto/src/CuptiActivityApi.cpp?lines=69). The logic is the same, just in a different layer.

Differential Revision: D91512438
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant