Skip to content

Reduce copying example batch allocations#55

Merged
lezcano merged 1 commit into
masterfrom
review/copying-example-allocations
Jun 7, 2026
Merged

Reduce copying example batch allocations#55
lezcano merged 1 commit into
masterfrom
review/copying-example-allocations

Conversation

@lezcano

@lezcano lezcano commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • preallocate copying-task input and target tensors
  • fill the sequence, marker, and target slices directly
  • add a focused layout test

Why

The training data generator previously allocated several zero and marker tensors and concatenated them on every iteration. Direct slice writes reduce allocations and copies while preserving the exact layout.

Validation

  • pytest -s --tb=short -n8 test/test_examples.py
  • included in the full remote suite: 60 passed, 1 skipped

@lezcano lezcano marked this pull request as ready for review June 7, 2026 16:49
@lezcano lezcano force-pushed the review/copying-example-allocations branch from aff02a7 to f52f198 Compare June 7, 2026 16:51
@lezcano lezcano merged commit 1eb2a56 into master Jun 7, 2026
9 checks passed
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