vllm.model_executor.models.nemotron3_5_transcribe_audio
¶
Audio tower of Nemotron-3.5-Transcribe.
A native port of the inference path of NeMo's AudioPerceptionModule with a
ParallelExpertEncoder:
waveform -> log-mel -> Parallel Expert Encoder -> Linear -> decoder width
The Parallel Expert Encoder runs an ASR TransformerEncoder and a streaming
Sortformer speaker encoder over the same mel features. Both run in windows of
window_frames encoder frames with left and right context, and the speaker
encoder carries a speaker cache and a FIFO between windows. Thresholded speaker
activity is added to the normalized ASR states through a fixed sinusoidal
kernel. Module names follow NeMo so the checkpoint loads by prefix.
Classes:
-
AudioPreprocessor–Holds the featurizer under NeMo's
preprocessor.featurizername. -
FeatureStacking–Stack
factorconsecutive frames and project them to the model width. -
MelSpectrogram–Log-mel features as NeMo
FilterbankFeaturescomputes them at inference. -
Nemotron3_5TranscribeAudioTower–Waveform to decoder-width embeddings: mel, Parallel Expert Encoder, Linear.
-
ParallelExpertEncoder–NeMo
ParallelExpertEncoderonline inference with a transformer ASR encoder. -
RotaryEmbedding–NeMo
RotaryPositionalEncoding: NeoX rotation of the firstrot_dimdims. -
SortformerModules–Speaker head and speaker cache of NeMo
SortformerModulesat inference. -
SortformerSpeakerEncoder–Streaming inference of the high-resolution Sortformer in NeMo's PEE.
-
SpeakerCacheState–Synchronous streaming state of the Sortformer speaker encoder.
-
TransformerEncoder–NeMo
TransformerEncoderwith RoPE and full attention, at inference.
Functions:
-
align_frames–Pad with the last frame, or truncate,
(B, T, S)totarget_lenframes. -
downsample_preds–Average
(B, T, S)probabilities over windows offactorframes. -
normalize_per_feature–NeMo
normalize_batch(x, seq_len, "per_feature")on(B, C, T)features.
AudioPreprocessor
¶
Bases: Module
Holds the featurizer under NeMo's preprocessor.featurizer name.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
FeatureStacking
¶
Bases: Module
Stack factor consecutive frames and project them to the model width.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
MelSpectrogram
¶
Bases: Module
Log-mel features as NeMo FilterbankFeatures computes them at inference.
Dither is off and no normalization is applied; frames past each row's
length are set to pad_value. The filterbank and window come from the
checkpoint and are held in the model dtype, as in the reference, and are
upcast to float32 for the computation.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
Nemotron3_5TranscribeAudioTower
¶
Bases: Module
Waveform to decoder-width embeddings: mel, Parallel Expert Encoder, Linear.
Methods:
-
encode–Encode each clip into its embeddings, returned in input order.
-
forward–Encode padded
(B, N)float32 audio into one embedding tensor per row. -
load_weights–Load NeMo
perception.*tensors, named without theperception..
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 | |
encode(signals, num_samples_cpu)
¶
Encode each clip into its embeddings, returned in input order.
Every row of a batch runs every window of the batch's longest clip, so a clip is batched only with clips that span as many windows.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
forward(audio, num_samples, num_samples_cpu)
¶
Encode padded (B, N) float32 audio into one embedding tensor per row.
num_samples_cpu holds the lengths on the host, so the window bounds
and the output lengths need no device-to-host copy.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
load_weights(weights)
¶
Load NeMo perception.* tensors, named without the perception..
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
ParallelExpertEncoder
¶
Bases: Module
NeMo ParallelExpertEncoder online inference with a transformer ASR encoder.
forward takes unnormalized (B, C, T) mel features and returns the
fused (B, d_model, T') states.
Attributes:
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 | |
dtype
property
¶
The model dtype, which quantized layers' weights may not have.
RotaryEmbedding
¶
NeMo RotaryPositionalEncoding: NeoX rotation of the first rot_dim dims.
Angles are computed in float32 on the CPU and stored in the activation dtype before use, as the reference does, so rotations match bit for bit.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
SortformerModules
¶
Bases: Module
Speaker head and speaker cache of NeMo SortformerModules at inference.
Methods:
-
speaker_probs–Upsampled speaker probabilities,
(B, T * upsample_factor, n_spk). -
update–NeMo
SortformerModules.streaming_update(synchronous).
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | |
_compress_spkcache(emb_seq, preds)
¶
Keep the spkcache_len most informative frames, as NeMo does.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
speaker_probs(hidden, lengths)
¶
Upsampled speaker probabilities, (B, T * upsample_factor, n_spk).
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
update(state, chunk, preds, lc, rc)
¶
NeMo SortformerModules.streaming_update (synchronous).
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
SortformerSpeakerEncoder
¶
Bases: Module
Streaming inference of the high-resolution Sortformer in NeMo's PEE.
Mirrors SortformerEncLabelModel.forward_streaming_step for synchronous
streaming without speaker permutation. Each step returns speaker
probabilities on the encoder frame grid for the window's core frames.
Methods:
-
step–Process one window of
(B, C, T)mel features.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 | |
step(features, lengths, state, left_offset, right_offset)
¶
Process one window of (B, C, T) mel features.
Returns the new state and the core frames' speaker probabilities on the encoder grid.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
SpeakerCacheState
dataclass
¶
Synchronous streaming state of the Sortformer speaker encoder.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
TransformerEncoder
¶
Bases: Module
NeMo TransformerEncoder with RoPE and full attention, at inference.
forward takes (B, C, T) mel features, or (B, T, d_model)
pre-encoded embeddings with bypass_pre_encode=True, and returns
(B, d_model, T') states with their lengths. Only keys are masked, so
padded frames never influence valid ones.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
_TowerLinear
¶
Bases: ReplicatedLinear
A replicated linear layer over the last dimension of any input shape.
vLLM's quantized kernels take (tokens, features); the tower's activations
are (batch, frames, features).
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
_linear(in_features, out_features, *, bias, quant_config, prefix)
¶
A linear layer the checkpoint's quantization config applies to by name.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
align_frames(preds, target_len)
¶
Pad with the last frame, or truncate, (B, T, S) to target_len frames.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
downsample_preds(preds, factor)
¶
Average (B, T, S) probabilities over windows of factor frames.
Source code in vllm/model_executor/models/nemotron3_5_transcribe_audio.py
normalize_per_feature(x, seq_len)
¶
NeMo normalize_batch(x, seq_len, "per_feature") on (B, C, T) features.