Commit db85cda
Add Transformer.prepare_cp_sequence_inputs (CP precursor)
Pull forward olmo-ddp's context-parallel sequence-sharding helper onto the base
Transformer. It shards input_ids/labels via the existing _cp_load_balancer.batch_shard
and returns the original sequence length so pipeline stages can rebuild RoPE buffers
consistently. Self-contained (core already has the CP load balancer); full CP train
wiring lands with the DDP train module.
The rest of olmo-ddp's shared transformer/block.py + model.py diff is intentionally
not taken: the shared-block norm split (#687) is rejected in favor of core's single
layer_norm, weight-tying is kept, and the v1 MoEHybrid overlap isn't on the OLMoDDP path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Tianhua Tao <taotianhua@outlook.com>1 parent 34a8084 commit db85cda
1 file changed
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
264 | 312 | | |
265 | 313 | | |
266 | 314 | | |
| |||
0 commit comments