Skip to content

Clean up dtypes for metadata fields (#1499) - #1499

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
ryanzhang22:export-D113458168
Jul 29, 2026
Merged

Clean up dtypes for metadata fields (#1499)#1499
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
ryanzhang22:export-D113458168

Conversation

@ryanzhang22

@ryanzhang22 ryanzhang22 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary:

Update a bunch of fields from int64_t to uint64_t:

  • Generic: kPythonParentId
  • Device properties: kId, kTotalGlobalMem, kSharedMemPerBlock, kSharedMemPerBlockOptin, kSharedMemPerMultiprocessor, kMaxSharedMemoryPerMultiProcessor
  • CUDA: kAllocatedSharedMemPerBlock, kBytes, kCbid, kChannel, kContext, kCorrelation, kEventId, kFromContext, kFromDevice, kGraphId, kGraphNodeId, kInContext, kInDevice, kQueued, kRegistersPerThread, kToContext, kToDevice, kWaitOnCudaEventId
  • ROCm: kBytes, kCid, kCorrelation, kHsaQueue, kSharedMemory, kStream

Previously, for simplicity, we represented all of these as int64_t, and just called static cast to move the fields that are actually produced as uint64_t to int64_t. This was fine for JSON write, and the unsigned -> signed cast is safe, but the Perfetto logger represents many of these fields as unsigned. I'd like to avoid the unnecessary unsigned -> signed -> unsigned roundtrip and we recently added uint64_t as a TypedValue -- so we can accurately represent this now.

All of the changes are used by Kineto only, so they should be safe. kPythonParentId is not used on the profiler side yet, so no compat issue there.

Reviewed By: scotts

Differential Revision: D113458168

@meta-cla meta-cla Bot added the cla signed label Jul 27, 2026
@meta-codesync

meta-codesync Bot commented Jul 27, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot changed the title Clean up dtypes for metadata fields Clean up dtypes for metadata fields (#1499) Jul 27, 2026
ryanzhang22 added a commit to ryanzhang22/kineto that referenced this pull request Jul 27, 2026
Summary:

Update a bunch of fields from int64_t to uint64_t:

- Generic: kPythonParentId
- Device properties: kId, kTotalGlobalMem, kSharedMemPerBlock, kSharedMemPerBlockOptin, kSharedMemPerMultiprocessor, kMaxSharedMemoryPerMultiProcessor
- CUDA: kAllocatedSharedMemPerBlock, kBytes, kCbid, kChannel, kContext, kCorrelation, kEventId, kFromContext, kFromDevice, kGraphId, kGraphNodeId, kInContext, kInDevice, kQueued, kRegistersPerThread, kToContext, kToDevice, kWaitOnCudaEventId
- ROCm: kBytes, kCid, kCorrelation, kHsaQueue, kSharedMemory, kStream

Previously, for simplicity, we represented all of these as `int64_t`, and just called static cast to move the fields that are actually produced as `uint64_t` to `int64_t`. This was fine for JSON write, and the unsigned -> signed cast is safe, but the Perfetto logger represents many of these fields as unsigned. I'd like to avoid the unnecessary unsigned -> signed -> unsigned roundtrip and we recently added uint64_t as a TypedValue -- so we can accurately represent this now.

Differential Revision: D113458168
Summary:

Update a bunch of fields from int64_t to uint64_t:

- Generic: kPythonParentId
- Device properties: kId, kTotalGlobalMem, kSharedMemPerBlock, kSharedMemPerBlockOptin, kSharedMemPerMultiprocessor, kMaxSharedMemoryPerMultiProcessor
- CUDA: kAllocatedSharedMemPerBlock, kBytes, kCbid, kChannel, kContext, kCorrelation, kEventId, kFromContext, kFromDevice, kGraphId, kGraphNodeId, kInContext, kInDevice, kQueued, kRegistersPerThread, kToContext, kToDevice, kWaitOnCudaEventId
- ROCm: kBytes, kCid, kCorrelation, kHsaQueue, kSharedMemory, kStream

Previously, for simplicity, we represented all of these as `int64_t`, and just called static cast to move the fields that are actually produced as `uint64_t` to `int64_t`. This was fine for JSON write, and the unsigned -> signed cast is safe, but the Perfetto logger represents many of these fields as unsigned. I'd like to avoid the unnecessary unsigned -> signed -> unsigned roundtrip and we recently added uint64_t as a TypedValue -- so we can accurately represent this now.

All of the changes are used by Kineto only, so they should be safe. `kPythonParentId` is not used on the profiler side yet, so no compat issue there.

Reviewed By: scotts

Differential Revision: D113458168
@meta-codesync
meta-codesync Bot merged commit 6f446fe into pytorch:main Jul 29, 2026
11 of 12 checks passed
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Jul 30, 2026
Includes the following commits:

- Clean up dtypes for metadata fields (pytorch/kineto#1499) 6f446fe
- [xpupti] Fix Windows build support for xpupti tests and multi-config generators. (pytorch/kineto#1394) 9e826ca
- Test ConfigLoader on-demand daemon poll ingress (pytorch/kineto#1504) 7674d28
- Remove comment about documentation (pytorch/kineto#1503) eeb3db9
- Remove HTA from README (pytorch/kineto#1502) 46b1c63
- Catch config-update exceptions so the poll thread can't crash the process (pytorch/kineto#1498) be334e1
- Drop EventProfiler config kind from ConfigLoader (pytorch/kineto#1496) e7c97a6
- Remove event-only config surface from Config (pytorch/kineto#1495) a3a0566
- Remove dead event profiler: runtime, CUPTI backends, build wiring (pytorch/kineto#1494) 36c2e05
- Decompose libkineto_defs.bzl source lists into atoms (pytorch/kineto#1493) 328fa51
- Add XPU synchronization events to XPUPTI profiler (pytorch/kineto#1395) 8285e5b
- Re-enable CI linting and lint all C++ (pytorch/kineto#1489) 2c41c01
- Test ConfigLoader handler fan-out (pytorch/kineto#1487) cccc5d1
- Update C++ lint tooling (pytorch/kineto#1488) 57e59e6
Pull Request resolved: #191526
Approved by: https://github.com/scotts
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