Skip to content

refactor post processing - #2381

Merged
ArthurZucker merged 25 commits into
feat/train_encode_splitfrom
perf/post-process-buffer-reuse
Sep 2, 2026
Merged

ArthurZucker merged 25 commits into
feat/train_encode_splitfrom
perf/post-process-buffer-reuse

Conversation

@ArthurZucker

@ArthurZucker ArthurZucker commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Simplified a lot the code as it should be:
Prefix, A, Infix, B, Suffix (with optional). We don't have more, so the iterators and etc are out

Extracted from #2361, which bundled it with the flat batch path; it is an
independent change to the general path and reviews better on its own.

The `batch_alloc` example the original commit added is left out: it imports
`tk_encode::Tokenizer`, which #2352 removed, so it no longer compiles. #2361
deleted it two commits later for the same reason.
@ArthurZucker ArthurZucker changed the title perf(pipeline): reuse sequence A's buffer in post_process refactor post processing Sep 2, 2026
Comment thread tokenizers/tk-encode/src/tokenizer/pipeline/post_processor.rs Outdated
Comment thread tokenizers/tk-encode/src/tokenizer/pipeline/post_processor.rs Outdated
Comment thread tokenizers/tk-encode/src/tokenizer/pipeline/post_processor.rs Outdated

This comment was marked as resolved.

@ArthurZucker ArthurZucker left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Finally looks good!

Comment thread tokenizers/tk-convert/src/convert.rs Outdated
Comment thread tokenizers/tk-convert/src/convert.rs Outdated
Comment thread tokenizers/tk-convert/src/convert.rs Outdated
Comment thread tokenizers/tk-convert/src/convert.rs Outdated
Comment thread tokenizers/tk-serialize/src/from_json/post_processors.rs Outdated
ArthurZucker and others added 4 commits September 3, 2026 07:17
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
chacha20 0.10.1 and 0.10.0 are both yanked from crates.io. The audit jobs run
`cargo audit -D warnings`, and a yanked crate is a denied warning, so the node
audit failed. The `--ignore RUSTSEC-*` flags cannot suppress it: "yanked" is an
index state, not an advisory ID.

Pulled in transitively by rand 0.10.2. tokenizers/Cargo.lock was already on
0.10.2; the node and python lockfiles were missed.

Verified with the exact CI command against all three lockfiles:
  node       exit 0
  python     exit 0 (was 1: "1 denied warning found")
  tokenizers exit 0
@ArthurZucker
ArthurZucker merged commit 0743ac0 into feat/train_encode_split Sep 2, 2026
15 checks passed
@ArthurZucker
ArthurZucker deleted the perf/post-process-buffer-reuse branch September 2, 2026 23:44
ArthurZucker added a commit that referenced this pull request Sep 3, 2026
* perf(pipeline): reuse sequence A's buffer in post_process

Extracted from #2361, which bundled it with the flat batch path; it is an
independent change to the general path and reviews better on its own.

The `batch_alloc` example the original commit added is left out: it imports
`tk_encode::Tokenizer`, which #2352 removed, so it no longer compiles. #2361
deleted it two commits later for the same reason.

* lol

* remove bloat

* Apply suggestion from @ArthurZucker

* move post processor code where it belongs

* more cleanup

* Apply batched suggestions from code review

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* remove stuff that belongs in convert

* update

* nit

* cleanup again

* fix

* fromat

* nit

* update

* remove bloat shit

* nit

* Apply batched suggestions from code review

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* weave is ai

* simple nit

* fix(deps): bump chacha20 to 0.10.2, the yanked 0.10.1 fails cargo audit

chacha20 0.10.1 and 0.10.0 are both yanked from crates.io. The audit jobs run
`cargo audit -D warnings`, and a yanked crate is a denied warning, so the node
audit failed. The `--ignore RUSTSEC-*` flags cannot suppress it: "yanked" is an
index state, not an advisory ID.

Pulled in transitively by rand 0.10.2. tokenizers/Cargo.lock was already on
0.10.2; the node and python lockfiles were missed.

Verified with the exact CI command against all three lockfiles:
  node       exit 0
  python     exit 0 (was 1: "1 denied warning found")
  tokenizers exit 0

(cherry picked from commit 0743ac0)
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.

2 participants