Skip to content

Add logging for async rejections (#1422)#1422

Open
ryanzhang22 wants to merge 2 commits into
pytorch:mainfrom
ryanzhang22:export-D103221867
Open

Add logging for async rejections (#1422)#1422
ryanzhang22 wants to merge 2 commits into
pytorch:mainfrom
ryanzhang22:export-D103221867

Conversation

@ryanzhang22
Copy link
Copy Markdown
Contributor

@ryanzhang22 ryanzhang22 commented Jun 3, 2026

Summary:

We do not currently allow async requests to be scheduled if there's an ongoing profiling session. When this happens, we log a warning and return early; there's no indication that the request failed unless the user is looking at the logs.

For better tracking, we should emit UST logs for these traces. We need to build some additional machinery here because the logger is seeded with metadata for the in-flight profiling session, and we can't clear it in order to write the async request rejection. So we add a write method which can independently write to the Scuba logs without messing with the existing logger state.

Reviewed By: scotts

Differential Revision: D103221867

@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 3, 2026

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

@meta-codesync meta-codesync Bot changed the title Add logging for async rejections Add logging for async rejections (#1422) Jun 4, 2026
ryanzhang22 added a commit to ryanzhang22/kineto that referenced this pull request Jun 4, 2026
Summary:

We do not currently allow async requests to be scheduled if there's an ongoing profiling session. When this happens, we log a warning and return early; there's no indication that the request failed unless the user is looking at the logs.

For better tracking, we should emit UST logs for these traces. We need to build some additional machinery here because the logger is seeded with metadata for the in-flight profiling session, and we can't clear it in order to write the async request rejection. So we add a write method which can independently write to the Scuba logs without messing with the existing logger state.

Reviewed By: scotts

Differential Revision: D103221867
…ytorch#1387)

Summary:

Currently, we don't reset the UST logger between sync (auto-trace)/async (on-demand) runs, so the data from one run can pollute the other. In particular, if we have an async then sync run, the sync run's UST logs will have artifacts from the async run.

Before sync/async's `configure` method, we add a `resetLoggerObservers` call. We add it here because `configure` is when we know the request was accepted.

Some of the logger's metadata is only set once and is persisted across runs (i.e. cuda version) and clearing it would reset it for future profiling sessions. So we introduce an option to add "persistent" metadata which is not cleared upon `.reset()`.

Reviewed By: sanrise, scotts

Differential Revision: D103278391
Summary:

We do not currently allow async requests to be scheduled if there's an ongoing profiling session. When this happens, we log a warning and return early; there's no indication that the request failed unless the user is looking at the logs.

For better tracking, we should emit UST logs for these traces. We need to build some additional machinery here because the logger is seeded with metadata for the in-flight profiling session, and we can't clear it in order to write the async request rejection. So we add a write method which can independently write to the Scuba logs without messing with the existing logger state.

Reviewed By: scotts

Differential Revision: D103221867
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