Skip to content

Py sched integration - #2063

Open
kfswain wants to merge 4 commits into
google:mainfrom
kfswain:py-sched-integration
Open

Py sched integration#2063
kfswain wants to merge 4 commits into
google:mainfrom
kfswain:py-sched-integration

Conversation

@kfswain

@kfswain kfswain commented Sep 1, 2026

Copy link
Copy Markdown

Description

This PR allows for the py-inference-scheduler to be optionally enabled for tunix. This has been tested on the gsm8k path, and includes a readme for integration.

  • I have added all the necessary unit tests for my change.
  • I have verified that my change does not break existing code and all unit tests pass.
  • I have added all appropriate doc-strings/documentation.
  • My PR is based on the latest changes of the main branch (if unsure, rebase the code).
  • I have signed the Contributor License Agreement.
  • I have followed Contribution Guidelines.

@google-cla

google-cla Bot commented Sep 1, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kfswain
kfswain force-pushed the py-sched-integration branch from 2130e5c to aa371cb Compare September 1, 2026 00:36
- distributed_rl_engine.sync_weights: reinstate the router
  notify_weights_synced call lost when sync moved to the coordinator
  path (fires only after a successful round)
- distributed_rl_engine_test: rewrite the two router-notification tests
  against the coordinator contract (mock coordinator; old broadcast API
  is gone)
- run_gsm8k_dist_grpo: drop duplicated --inference_addr argparse flag
  (rebase artifact; argparse raises on startup)
- gke/job.yaml: rename mesh env knobs MESH_FSDP/MESH_TP ->
  TRAINER_FSDP/TRAINER_TP to match the rebased launcher
Upstream generate() now rejects bare prompt items; dict items must carry
prompt_id and are normalized to RolloutRequests, so the router receives
route_key/request_id/prompt hints on a single unified path.
@kfswain
kfswain force-pushed the py-sched-integration branch from 27bba60 to 19cfa87 Compare September 1, 2026 23:07
@tianshub

tianshub commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks for doing the integration @kfswain . Curious do we have measurement on the performance/throughput before and after?

fi
}

cleanup() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some changes in this file is reverting the code to old commits.

ROLLOUT_CMD+=(--use_lora)
fi
print_command "Rollout command" PYTHONUNBUFFERED=1 "${ROLLOUT_CMD[@]}"
PYTHONUNBUFFERED=1 "${ROLLOUT_CMD[@]}" > "$ROLLOUT_LOG" 2>&1 &

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only launch one rollout worker, right ?

parser.add_argument("--max_prompt_length", type=int, default=1024)
parser.add_argument("--max_response_length", type=int, default=1024)
parser.add_argument("--train_micro_batch_size", type=int, default=1)
parser.add_argument("--trainer_addr", type=str, default="localhost:20000")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These address flags are unnecessary after #2060 (merged)

if isinstance(actor, str):
self._actors.append(ActorHandle.from_address(actor))
elif isinstance(actor, ActorHandle):
elif callable(getattr(actor, "submit", None)) and callable(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like anti-pattern, allowing arbitrary objects to enter ActorPool.

@kfswain

kfswain commented Sep 4, 2026

Copy link
Copy Markdown
Author

Curious do we have measurement on the performance/throughput before and after?
Not currently, the default algorithm (or any algo really) can't do much to help with GSM8K, as the prefill is fairly small, and its typically single turn, so there is low prefix match & no options to capitalize on it.

We see improvements with things like DeepSWE that will have multiple turns and need to balance KV affinity with saturation. I was just doing the integration here and prove it works, and start doing deeper tests as I can get my hands on TPU capacity (gsm8k is much easier to test than DeepSWE b/c capacity reasons)

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.

4 participants