Repository navigation
Benchmark harness, ONNX/INT8 export and local proxy results - #19
Merged
Merged
Conversation
- Shared, torch-free decoder: backends only produce hidden states and BIO probabilities; span, category, role and group heads run in NumPy, so PyTorch and ONNX Runtime share one decoding path. - `triggermap export onnx`: encoder + BIO head to ONNX (dynamic batch and sequence axes, eager attention) plus dynamic INT8; OnnxExtractor runs on ONNX Runtime without PyTorch. FP32 parity on the real DistilBERT and DeBERTa-v3-small backbones: max logit difference 5e-6, identical predictions. `onnx` (runtime) and `export` extras. - Benchmark harness: declared workload from train/dev pools bucketed by subword length (workload-v1), fresh-process workers for cold start and peak RSS, warm p50/p95 per bucket, throughput, threads and batch sizes, resumable checkpoints, HTTP load test that bypasses the prediction cache, reports that judge targets only on the documented host. - Latency-only bundles (pretrained encoders, untrained heads) for measuring serving cost before training; release creation refuses them. - Local proxy results (Apple M1, 2 inference threads) and load tests in reports/benchmarks/ and docs/benchmarks.md; O(log n) sentence-scope index for decoding (1.1x on the measured case).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 6 (production), feature 1. Results and caveats:
docs/benchmarks.md.What
models/transformer/decode.py): backends only produce hidden states and BIO probabilities, and the span, category, role and group heads run in NumPy. The refactor is behaviour-preserving: every existing transformer test passes unchanged.triggermap export onnx --bundle B --out O --int8 O8): exports the encoder and BIO head with dynamic axes and eager attention, plus dynamic INT8.OnnxExtractorruns on ONNX Runtime without PyTorch. Dependencies are split into anonnxruntime extra and anexportextra.triggermap bench workload | latency-bundle | run | load):reports/benchmarks/workload-v1.json);release createrefuses them.Measured
Lessons
The first attempt ran the matrix in a 4 GB container on an 8 GB laptop with other containers running. The host swapped about 15 GB, Docker stopped responding, and that run was discarded. That is why runs are now checkpointed. The sentence-scope index found while diagnosing it measured only 1.1× faster on the real case; it is kept for correctness and scaling and reported as such.
206 tests pass.