Skip to content

Decode prompt token trace payloads#455

Open
SunnySoldier357 wants to merge 2 commits into
mainfrom
sandeep/fir2-1747-remote-rollout-prompt-token-payloads
Open

Decode prompt token trace payloads#455
SunnySoldier357 wants to merge 2 commits into
mainfrom
sandeep/fir2-1747-remote-rollout-prompt-token-payloads

Conversation

@SunnySoldier357

@SunnySoldier357 SunnySoldier357 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • New standalone eval_protocol/tracing/ package for decoding Fireworks tracing-gateway payloads, independent of EvaluationRow/rollout machinery (stdlib + zstandard only). It is the "folder you can point at" for extracting gateway payloads even without using EP for rollouts.
  • PayloadType StrEnum + DecodedPayload + a master decode_payloads(payloads) registry that runs every decoder over a trace's payloads in one call (plus decode_payload() and decode_trace()). Adding a payload type is one decoder + one PAYLOAD_DECODERS entry.
  • Decode pti/v1 as zstd(JSON int array) to match the gateway (fw-ai/fireworks#29923). The lp/v1 and r3/v1 decoders are moved verbatim.
  • Refactor FireworksTracingAdapter to use decode_payloads instead of three copy-pasted decode blocks; execution_metadata.extra keys are unchanged. Removed adapters/{pti,lp,r3}_deserializer.py.
  • Adds tests/tracing/test_registry.py and a package README.md.

Test plan

  • Unit: conda run -n pilot python -m pytest tests/tracing/test_registry.py tests/adapters/test_fireworks_tracing_prompt_token_ids.py tests/adapters/test_fireworks_tracing_logprobs.py tests/adapters/test_lp_deserializer.py tests/adapters/test_r3_deserializer.py (pass; one pre-existing skip that needs the mono serializer).
  • Live E2E against the dev tracing gateway + accounts/pyroworks-dev/deployments/malaysia2-intended-butterfly: scripts/test_remote_rollout_prompt_token_ids.py hydrates assistant_turn_payloads[0].prompt_token_ids with 13 ids. prompt_token_ids and logprobs decoded live through the new registry; router_replay covered by unit tests (deployment has MoE stats disabled).

Requires fw-ai/fireworks#29923 (the gateway must emit pti/v1 as zstd(JSON)); land together.

Hydrate prompt_token_ids from Fireworks tracing payloads so RemoteRolloutProcessor can pass token-native prompt IDs through assistant turn metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@SunnySoldier357 SunnySoldier357 self-assigned this Jun 12, 2026
Move the per-payload binary deserializers out of adapters/ into a
dependency-light eval_protocol/tracing package: a PayloadType StrEnum,
DecodedPayload, and a decode_payloads registry (master decode) usable without
EvaluationRow/rollout machinery. Refactor FireworksTracingAdapter to use the
registry instead of three copy-pasted decode blocks, and decode pti/v1 as
zstd(JSON int array) to match the gateway. Adds tests/tracing and a README.

Co-authored-by: Cursor <cursoragent@cursor.com>
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

Successfully merging this pull request may close these issues.

1 participant