Stop routing LOG() messages into JSON trace output#1460
Closed
scotts wants to merge 1 commit into
Closed
Conversation
Summary: **Problem:** In non-glog builds, we captured every `LOG(WARNING)`/`LOG(ERROR)` emitted during a trace and wrote them into the JSON trace as top-level `WARNING`/`ERROR` arrays. But no one ever consumed these messages - all consumers ignore them. And they sometimes caused JSON parse problems downstream because the log messages sometimes were not valid JSON. **Fix:** Remove the channel entirely instead of continuing to sanitize it. The log-bucket parameter (`unordered_map<string, vector<string>>`) on `ActivityLogger::finalizeTrace` carried only these log lines, so it is dropped from the interface and every override, along with the JSON emit loop and `sanitizeLogStrForJSON` in `output_json.cpp` and the producer machinery. Behavior is now uniform across glog and non-glog builds. Differential Revision: D110199228
|
@scotts has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110199228. |
|
This pull request has been merged in 9612d06. |
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Jul 7, 2026
Includes the following commits: - Add typed metadata fields for PyTorch-side metadata (pytorch/kineto#1465) 33c4075 - Migrate GenericTraceActivity to typed metadata (pytorch/kineto#1464) 7e6138a - Add a way for people to fetch device properties as typed metadata (pytorch/kineto#1463) 2c6b742 - Move vendor_dynolog.sh into third_party/dynolog (pytorch/kineto#1466) a800919 - Vendor dynolog ipcfabric headers for the OSS CMake build (pytorch/kineto#1446) 0a3d723 - Add additional types to TypedMetadata.h and visitor classes (pytorch/kineto#1462) 30fea25 - Stop routing LOG() messages into JSON trace output (pytorch/kineto#1460) 9612d06 - Fix CQS signal modernize-deprecated-headers in fbcode/kineto/libkineto (pytorch/kineto#1461) fa98efe - Parameterize device collective-row metadata enrichment by backend (pytorch/kineto#1444) 079e719 - Fix incorrect enum usage preventing CUPTI early-init (pytorch/kineto#1458) e31e83e - Daily `arc lint --take CLANGFORMAT` 8edb29e Pull Request resolved: #189104 Approved by: https://github.com/scotts
This was referenced Jul 8, 2026
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Jul 10, 2026
Includes the following commits: - Close leaked /proc/self/ns/pid fd in pidNamespace() (pytorch/kineto#1474) d1b7cab - Add old dynolog path to .gitignore (pytorch/kineto#1475) 090e757 - Test async client-interface and memory-snapshot paths (pytorch/kineto#1473) 634515a - Fix CPU->GPU flow links via activity type, not an API-name allowlist (pytorch/kineto#1467) 0f72203 - Broaden AsyncActivityProfilerHandler test coverage (pytorch/kineto#1472) 691a148 - Add XPU to external correlation IDs excluded types (pytorch/kineto#1390) 6afebaf - Rename vendored dynolog dir to prevent name collision (pytorch/kineto#1471) cb6e5f7 - Fix: JSON-escape double quotes in chrome-trace event names (pytorch/kineto#1459) eba157a - Pull shared test helpers into the test-utils namespace (pytorch/kineto#1470) 332e2ed - Fix CQS signal modernize-use-integer-sign-comparison in fbcode/kineto/libkineto (pytorch/kineto#1469) b2fd708 - Consolidate createTempTraceFile into a RAII util (pytorch/kineto#1468) d3345f4 - Add typed metadata fields for PyTorch-side metadata (pytorch/kineto#1465) 33c4075 - Migrate GenericTraceActivity to typed metadata (pytorch/kineto#1464) 7e6138a - Add a way for people to fetch device properties as typed metadata (pytorch/kineto#1463) 2c6b742 - Move vendor_dynolog.sh into third_party/dynolog (pytorch/kineto#1466) a800919 - Vendor dynolog ipcfabric headers for the OSS CMake build (pytorch/kineto#1446) 0a3d723 - Add additional types to TypedMetadata.h and visitor classes (pytorch/kineto#1462) 30fea25 - Stop routing LOG() messages into JSON trace output (pytorch/kineto#1460) 9612d06 - Fix CQS signal modernize-deprecated-headers in fbcode/kineto/libkineto (pytorch/kineto#1461) fa98efe - Parameterize device collective-row metadata enrichment by backend (pytorch/kineto#1444) 079e719 - Fix incorrect enum usage preventing CUPTI early-init (pytorch/kineto#1458) e31e83e - Daily `arc lint --take CLANGFORMAT` 8edb29e Pull Request resolved: #189542 Approved by: https://github.com/scotts, https://github.com/Skylion007
ValerianRey
pushed a commit
to ValerianRey/pytorch
that referenced
this pull request
Jul 10, 2026
Includes the following commits: - Close leaked /proc/self/ns/pid fd in pidNamespace() (pytorch/kineto#1474) d1b7cab - Add old dynolog path to .gitignore (pytorch/kineto#1475) 090e757 - Test async client-interface and memory-snapshot paths (pytorch/kineto#1473) 634515a - Fix CPU->GPU flow links via activity type, not an API-name allowlist (pytorch/kineto#1467) 0f72203 - Broaden AsyncActivityProfilerHandler test coverage (pytorch/kineto#1472) 691a148 - Add XPU to external correlation IDs excluded types (pytorch/kineto#1390) 6afebaf - Rename vendored dynolog dir to prevent name collision (pytorch/kineto#1471) cb6e5f7 - Fix: JSON-escape double quotes in chrome-trace event names (pytorch/kineto#1459) eba157a - Pull shared test helpers into the test-utils namespace (pytorch/kineto#1470) 332e2ed - Fix CQS signal modernize-use-integer-sign-comparison in fbcode/kineto/libkineto (pytorch/kineto#1469) b2fd708 - Consolidate createTempTraceFile into a RAII util (pytorch/kineto#1468) d3345f4 - Add typed metadata fields for PyTorch-side metadata (pytorch/kineto#1465) 33c4075 - Migrate GenericTraceActivity to typed metadata (pytorch/kineto#1464) 7e6138a - Add a way for people to fetch device properties as typed metadata (pytorch/kineto#1463) 2c6b742 - Move vendor_dynolog.sh into third_party/dynolog (pytorch/kineto#1466) a800919 - Vendor dynolog ipcfabric headers for the OSS CMake build (pytorch/kineto#1446) 0a3d723 - Add additional types to TypedMetadata.h and visitor classes (pytorch/kineto#1462) 30fea25 - Stop routing LOG() messages into JSON trace output (pytorch/kineto#1460) 9612d06 - Fix CQS signal modernize-deprecated-headers in fbcode/kineto/libkineto (pytorch/kineto#1461) fa98efe - Parameterize device collective-row metadata enrichment by backend (pytorch/kineto#1444) 079e719 - Fix incorrect enum usage preventing CUPTI early-init (pytorch/kineto#1458) e31e83e - Daily `arc lint --take CLANGFORMAT` 8edb29e Pull Request resolved: pytorch#189542 Approved by: https://github.com/scotts, https://github.com/Skylion007
vishalgoyal316
pushed a commit
to vishalgoyal316/pytorch
that referenced
this pull request
Jul 16, 2026
Includes the following commits: - Add typed metadata fields for PyTorch-side metadata (pytorch/kineto#1465) 33c4075 - Migrate GenericTraceActivity to typed metadata (pytorch/kineto#1464) 7e6138a - Add a way for people to fetch device properties as typed metadata (pytorch/kineto#1463) 2c6b742 - Move vendor_dynolog.sh into third_party/dynolog (pytorch/kineto#1466) a800919 - Vendor dynolog ipcfabric headers for the OSS CMake build (pytorch/kineto#1446) 0a3d723 - Add additional types to TypedMetadata.h and visitor classes (pytorch/kineto#1462) 30fea25 - Stop routing LOG() messages into JSON trace output (pytorch/kineto#1460) 9612d06 - Fix CQS signal modernize-deprecated-headers in fbcode/kineto/libkineto (pytorch/kineto#1461) fa98efe - Parameterize device collective-row metadata enrichment by backend (pytorch/kineto#1444) 079e719 - Fix incorrect enum usage preventing CUPTI early-init (pytorch/kineto#1458) e31e83e - Daily `arc lint --take CLANGFORMAT` 8edb29e Pull Request resolved: pytorch#189104 Approved by: https://github.com/scotts
vishalgoyal316
pushed a commit
to vishalgoyal316/pytorch
that referenced
this pull request
Jul 16, 2026
Includes the following commits: - Close leaked /proc/self/ns/pid fd in pidNamespace() (pytorch/kineto#1474) d1b7cab - Add old dynolog path to .gitignore (pytorch/kineto#1475) 090e757 - Test async client-interface and memory-snapshot paths (pytorch/kineto#1473) 634515a - Fix CPU->GPU flow links via activity type, not an API-name allowlist (pytorch/kineto#1467) 0f72203 - Broaden AsyncActivityProfilerHandler test coverage (pytorch/kineto#1472) 691a148 - Add XPU to external correlation IDs excluded types (pytorch/kineto#1390) 6afebaf - Rename vendored dynolog dir to prevent name collision (pytorch/kineto#1471) cb6e5f7 - Fix: JSON-escape double quotes in chrome-trace event names (pytorch/kineto#1459) eba157a - Pull shared test helpers into the test-utils namespace (pytorch/kineto#1470) 332e2ed - Fix CQS signal modernize-use-integer-sign-comparison in fbcode/kineto/libkineto (pytorch/kineto#1469) b2fd708 - Consolidate createTempTraceFile into a RAII util (pytorch/kineto#1468) d3345f4 - Add typed metadata fields for PyTorch-side metadata (pytorch/kineto#1465) 33c4075 - Migrate GenericTraceActivity to typed metadata (pytorch/kineto#1464) 7e6138a - Add a way for people to fetch device properties as typed metadata (pytorch/kineto#1463) 2c6b742 - Move vendor_dynolog.sh into third_party/dynolog (pytorch/kineto#1466) a800919 - Vendor dynolog ipcfabric headers for the OSS CMake build (pytorch/kineto#1446) 0a3d723 - Add additional types to TypedMetadata.h and visitor classes (pytorch/kineto#1462) 30fea25 - Stop routing LOG() messages into JSON trace output (pytorch/kineto#1460) 9612d06 - Fix CQS signal modernize-deprecated-headers in fbcode/kineto/libkineto (pytorch/kineto#1461) fa98efe - Parameterize device collective-row metadata enrichment by backend (pytorch/kineto#1444) 079e719 - Fix incorrect enum usage preventing CUPTI early-init (pytorch/kineto#1458) e31e83e - Daily `arc lint --take CLANGFORMAT` 8edb29e Pull Request resolved: pytorch#189542 Approved by: https://github.com/scotts, https://github.com/Skylion007
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Problem:
In non-glog builds, we captured every
LOG(WARNING)/LOG(ERROR)emitted during a trace and wrote them into the JSON trace as top-levelWARNING/ERRORarrays. But no one ever consumed these messages - all consumers ignore them. And they sometimes caused JSON parse problems downstream because the log messages sometimes were not valid JSON.Fix:
Remove the channel entirely instead of continuing to sanitize it. The log-bucket parameter (
unordered_map<string, vector<string>>) onActivityLogger::finalizeTracecarried only these log lines, so it is dropped from the interface and every override, along with the JSON emit loop andsanitizeLogStrForJSONinoutput_json.cppand the producer machinery. Behavior is now uniform across glog and non-glog builds.Differential Revision: D110199228