Add LaughterSegmentation to contrib#56
Open
jimburtoft wants to merge 3 commits intoaws-neuron:mainfrom
Open
Conversation
Wav2Vec2-based laughter detection model (315M params) compiled with torch_neuronx.trace(). Includes single-core and DataParallel benchmarks, accuracy validation, and end-to-end inference demo on inf2.xlarge.
12/12 tests pass on inf2.xlarge (SDK 2.28, PyTorch 2.9): - Smoke tests (model loads and runs) - Accuracy: cosine similarity >= 0.999, 100% frame agreement - DataParallel: 1.88x speedup on 2 cores (176.5 W/s) - Performance: 101.5 W/s throughput, 9.85 ms p50 latency
Added maintainer information for Jim Burtoft.
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.
Description
Add LaughterSegmentation, a Wav2Vec2-based laughter detection model compiled with torch_neuronx.trace(). Includes a self-contained Jupyter notebook with compilation, single-core and DataParallel benchmarks, accuracy validation against CPU reference, and an end-to-end inference demo. Also documents a weight_norm parametrization crash workaround required on SDK 2.28+.
Model Information
Model Name: LaughterSegmentation (omine-me/LaughterSegmentation)
Model Architecture: Wav2Vec2ForAudioFrameClassification (~315M params, FP32)
Purpose: Audio frame classification -- detects laughter segments in speech audio
Checklist
Required Components
Optional Components
Folder Structure
/contrib/models/LaughterSegmentation/
README.md
laughter_neuron_inf2.ipynb # notebook with executed outputs
/test
init.py
/unit
init.py
/integration
init.py
test_model.py
Testing
How did you test this change?
Ran pytest on a fresh inf2.xlarge instance (sa-east-1) with the Deep Learning AMI Neuron (Ubuntu 24.04) 20260227 and the pre-installed PyTorch inference venv.
source /opt/aws_neuronx_venv_pytorch_inference_vllm_0_13/bin/activate
pip install safetensors pytest
pytest test_model.py --capture=tee-sys -v
Test Results:
test_model.py::TestModelLoads::test_neuron_model_loads PASSED [ 8%]
test_model.py::TestModelLoads::test_neuron_model_runs PASSED [ 16%]
test_model.py::TestAccuracy::test_cosine_similarity[random_normal] PASSED [ 25%]
test_model.py::TestAccuracy::test_cosine_similarity[quiet_noise] PASSED [ 33%]
test_model.py::TestAccuracy::test_cosine_similarity[loud_signal] PASSED [ 41%]
test_model.py::TestAccuracy::test_cosine_similarity[sine_440hz] PASSED [ 50%]
test_model.py::TestAccuracy::test_cosine_similarity[silence] PASSED [ 58%]
test_model.py::TestAccuracy::test_frame_agreement PASSED [ 66%]
test_model.py::TestDataParallel::test_data_parallel_runs PASSED [ 75%]
test_model.py::TestDataParallel::test_data_parallel_speedup PASSED [ 83%]
test_model.py::TestPerformance::test_throughput PASSED [ 91%]
test_model.py::TestPerformance::test_latency PASSED [100%]
======================= 12 passed, 2 warnings in 51.49s =======================
Key metrics:
Compatibility
Tested with:
Additional Information
Related Issues
None
vLLM Integration
By submitting this PR, I confirm that: