Skip to content

Commit 3fcfba4

Browse files
committed
merge: origin/main into row/LTX25-TILED-DECODE-FIX (indextts2 conditioning front end)
Main landed 5e646d9 and d374e83 (`MODEL-MM-indextts2`, #743 and #745) while this row was finishing its handoff checks. Merged forward so the pushed head is a descendant of main; a rejected push would otherwise be git protecting someone else's merge. No conflicts. Verified rather than assumed: after this merge the branch's entire record delta versus main is `.agents/roadmap_v1.md` and its own spec, and the roadmap delta is exactly ONE line — the Row 2 sentence inside issue #644's cell. `docs/FEATURES.md`'s `LTX-2.5 tiled + streaming Conv VAE decode` row and `tests/CMakeLists.txt`'s `test_ltx2_tiling` registration are the only other keys this branch owns, and both are intact. Three preflight gates are red at this head and none is this row's, recorded here so the next reader does not re-derive it: * `audit-live-rows` and `test_audit_live_rows` fail on the stale ACTIVE row `MODEL-MUSIC-minimax-music3-...`, which lives in `.agents/model-matrix.md` — a file this branch does not touch at all, so its input is byte-identical to main's; * `test_cpu_x86_llamacpp_floor` exits `NO_QUIET_WINDOW` (busy 125%, load 78) with several agents building on the shared box, which is the documented failure mode of that floor test rather than a regression. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:claude-opus-5 [Claude Code]
2 parents a1b0a93 + d374e83 commit 3fcfba4

10 files changed

Lines changed: 604 additions & 2 deletions

File tree

.agents/specs/indextts-2-5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ they pass over a smaller network than the checkpoint holds:
336336
| ~~`s2mel.pth` `net.cfm.estimator`~~ | ~~`wavenet.*`~~ | **PORTED** in `wavenet.cpp`, gated against upstream `WN` at reduced dims (3 cases / 133 assertions, 6 mutations caught). Not a conditioning stack but the DiT's FINAL LAYER: the config sets `final_layer_type: wavenet`, which is also what `t_embedder2`, `conv1` and `conv2` belong to |
337337
| ~~same~~ | ~~`skip_linear`, `layers.N.skip_in_linear`~~ | BOTH **PORTED**: the long skip in `dit_tail.cpp`, the per-layer U-Net skip in `dit_skip.cpp`. The routing was RECORDED from upstream's own Transformer rather than read off the formula (`scripts/gen-dit-skip-schedule.py`): at the shipped depth 13, layers 0-5 emit, 7-12 receive LIFO so layer 7 takes layer 5's output, and layer 6 does neither. At EVEN depth there is one more emitter than receiver and the earliest skip is never consumed; we report that rather than correct it |
338338
| ~~same~~ | ~~`t_embedder2`, `conv1`, `conv2`~~ | **PORTED** in `dit_tail.cpp` together with `skip_linear`, `res_projection` and `final_layer`, gated against upstream's own DiT modules end to end (4 cases, 6 mutations caught). Note the coupling upstream hides by setting both to 512: `final_layer` is sized at the WAVENET width but conditioned on `t1` at the DiT width, so the two must be equal. We refuse unequal widths by name |
339-
| same | `cond_embedder`, `content_mask_embedder`, `cond_projection`, `cond_x_merge_linear`, `res_projection`, `conv1`, `conv2` | The conditioning front end |
339+
| ~~same~~ | ~~`cond_projection`, `cond_x_merge_linear`~~; `content_mask_embedder` | **PORTED** in `dit_front.cpp`, both the conditional and the CFG unconditional branch. **`cond_embedder` is DEAD in 2.5**: upstream forces `cond_in_module = cond_projection` and the `content_type` switch that would have selected it is commented out, so the tensor ships and is never read. A port that restored the switch would read a tensor this model does not use |
340340
| `s2mel.pth` `net.length_regulator` | `mask_token`, `embedding`, `content_in_proj` | Our `lenreg` port has the interpolate/GroupNorm/Mish stack and none of these |
341341
| `s2mel.pth` | `net.gpt_layer` | Three weight/bias pairs; unmodeled and unexplained |
342342
| `codec.pth` | `model.encoder.*`, `model.down`, `model.up` | Only the quantizer (`fvq`) and the Vocos-shaped decoder are ported |

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ add_library(vllm STATIC
777777
src/vllm/model_executor/models/wavenet.cpp
778778
src/vllm/model_executor/models/dit_tail.cpp
779779
src/vllm/model_executor/models/dit_skip.cpp
780+
src/vllm/model_executor/models/dit_front.cpp
780781
src/vllm/model_executor/models/indextts2_s2mel_loader.cpp
781782
src/vllm/model_executor/models/vocos.cpp
782783
src/vllm/model_executor/models/lenreg.cpp

docs/FEATURES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ on the committed fixture); reranking/classify models are not yet registered.
197197
| Video | ✅ correctness-gated ||||
198198
| Audio | ✅ correctness-gated ||||
199199
| Video+audio GENERATION (MiniMax-H3 DiT, LTX-2.5 DiT) | ◐ H3: all three modalities COHERENT on Q4_K_M (t2va, fl2va, ref2va; §8.20); the NVFP4 arm carries the patch grid; GGUF/NVFP4/bf16 loaders, pruned too (§8.21). LTX-2.5: a second lane, `SPIKE`, gated at reduced dims | ✅ H3 (vllm-omni, BF16-only, no quantized arm); LTX-2.5 only through the generic diffusers adapter, no native recipe ([vllm-omni#6066](https://github.com/vllm-project/vllm-omni/issues/6066)) |||
200-
| Speech / audio GENERATION (TTS, vLLM-Omni lane) | ◐ IndexTTS-2.5 only: the DiT path runs on the REAL shipped weights via a checkpoint loader; other stages gated at reduced dims, more named missing by the manifest. No render, no route (#634) | ✅ (vllm-omni: MOSS-TTS, Qwen3-TTS, Higgs Audio v3, Voxtral TTS, IndexTTS-2.5) | not assessed | not assessed |
200+
| Speech / audio GENERATION (TTS, vLLM-Omni lane) | ◐ IndexTTS-2.5 only: the DiT front end, blocks' skips and tail are ported, and the tail runs on REAL shipped weights; other stages gated at reduced dims. No render, no route (#634) | ✅ (vllm-omni: MOSS-TTS, Qwen3-TTS, Higgs Audio v3, Voxtral TTS, IndexTTS-2.5) | not assessed | not assessed |
201201
| MUSIC generation (MiniMax-Music3) | ☐ not generating. The W1 checkpoint LOADER has landed ([spec](../.agents/specs/minimax-music3.md), #672); no stage runs yet. Lyrics plus a structured description in, a multi-minute stereo song out | ☐ absent from the pin, from vLLM `main` and from `vllm-omni` alike | ◐ served by SGLang-Omni, a third repository, which loads the NATIVE checkpoint layout ||
202202
| Multimodal over the OpenAI server | ◐ image request path wired, forward pending ||||
203203

docs/USAGE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,6 +2366,9 @@ WAVENET_SRC=/path/to/index-tts/indextts/s2mel/modules \
23662366

23672367
DIT_SRC=/path/to/index-tts/indextts/s2mel/modules \
23682368
python3 scripts/gen-dit-tail-goldens.py --out tests/vllm/models/dit_tail_goldens.inc
2369+
2370+
DIT_SRC=/path/to/index-tts/indextts/s2mel/modules \
2371+
python3 scripts/gen-dit-front-goldens.py --out tests/vllm/models/dit_front_goldens.inc
23692372
```
23702373

23712374
The U-Net skip routing is recorded rather than generated into an `.inc`: this
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// The S2Mel DiT FRONT END: how the conditioned input is built (#634).
2+
//
3+
// Upstream `indextts/s2mel/modules/diffusion_transformer.py:206-226`, index-tts
4+
// @4f8792ff120cd3ea470dd511e997a17c86cddd10, under the shipped config
5+
// (`style_condition: true`, `style_as_token: false`):
6+
//
7+
// cond = cond_projection(cond)
8+
// x_in = cat([x^T, prompt_x^T, cond], -1) // 80 + 80 + 512 = 672
9+
// x_in = cat([x_in, style repeated over T], -1) // + 192 = 864
10+
// if class_dropout: x_in[..., in_channels:] *= 0
11+
// x_in = cond_x_merge_linear(x_in) // 864 -> hidden
12+
//
13+
// `cond_x_merge_linear.weight` is [512, 864] in the shipped checkpoint, and 864
14+
// is exactly 512 + 80 * 2 + 192, so the concatenation order and widths are
15+
// pinned by the weight itself.
16+
//
17+
// TWO THINGS CONTRADICT WHAT A READER EXPECTS.
18+
//
19+
// `cond_in_module` is FORCED to `cond_projection` upstream: the `content_type`
20+
// switch that would have chosen `cond_embedder` is commented out. So
21+
// `cond_embedder` is present in `s2mel.pth` and DEAD in 2.5. A port that
22+
// "restored" the switch would read a tensor this model never uses.
23+
//
24+
// `class_dropout` zeroes everything AFTER the first `in_channels` columns,
25+
// keeping x and dropping prompt, cond and style. That is not a training-only
26+
// path: `mask_content` sets it at inference, so it IS the classifier-free
27+
// guidance unconditional branch that `cfm::EulerStepCfg` consumes.
28+
#pragma once
29+
30+
#include <cstdint>
31+
#include <vector>
32+
33+
namespace vllm {
34+
namespace models {
35+
namespace dit_front {
36+
37+
struct Weights {
38+
std::vector<float> cond_proj_w; // [hidden, hidden]
39+
std::vector<float> cond_proj_b; // [hidden]
40+
std::vector<float> merge_w; // [hidden, in_channels * 2 + hidden + style]
41+
std::vector<float> merge_b; // [hidden]
42+
};
43+
44+
struct Config {
45+
int64_t hidden = 0;
46+
int64_t in_channels = 0;
47+
int64_t style = 0;
48+
int64_t frames = 0;
49+
};
50+
51+
// x and prompt_x are [in_channels, frames] CHANNEL-major, as upstream holds
52+
// them before its transpose. cond is [frames, hidden]. style is [style].
53+
// `unconditional` selects the CFG branch that zeroes everything past
54+
// in_channels. Returns [frames, hidden].
55+
std::vector<float> BuildXIn(const Config& cfg, const Weights& w,
56+
const std::vector<float>& x,
57+
const std::vector<float>& prompt_x,
58+
const std::vector<float>& cond,
59+
const std::vector<float>& style, bool unconditional);
60+
61+
} // namespace dit_front
62+
} // namespace models
63+
} // namespace vllm

scripts/gen-dit-front-goldens.py

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
#!/usr/bin/env python3
2+
"""Emit C++ goldens for the S2Mel DiT FRONT END: how x_in is built.
3+
4+
Upstream `indextts/s2mel/modules/diffusion_transformer.py:243-253`, index-tts
5+
@4f8792ff120cd3ea470dd511e997a17c86cddd10, under the shipped config
6+
(`long_skip_connection: true`, `final_layer_type: wavenet`):
7+
8+
if long_skip_connection: x_res = skip_linear(cat([x_res, x], dim=-1))
9+
x = conv1(x_res) # Linear D -> wavenet hidden
10+
x = x.transpose(1, 2) # [B, H, T]
11+
t2 = t_embedder2(t)
12+
x = wavenet(x, x_mask, g=t2.unsqueeze(2)).transpose(1, 2) + res_projection(x_res)
13+
x = final_layer(x, t1).transpose(1, 2)
14+
x = conv2(x) # Conv1d H -> in_channels, kernel 1
15+
16+
The DiT is constructed for real at reduced dims, so every module here is
17+
upstream's own; only the SEQUENCE is restated, and it is restated once, next to
18+
the upstream line numbers it copies.
19+
20+
Usage: DIT_SRC=<path to indextts/s2mel/modules> python3 \
21+
scripts/gen-dit-front-goldens.py --out tests/vllm/models/dit_front_goldens.inc
22+
"""
23+
24+
from __future__ import annotations
25+
26+
import argparse
27+
import importlib.util
28+
import os
29+
import sys
30+
import types
31+
from pathlib import Path
32+
from types import SimpleNamespace
33+
34+
import torch
35+
36+
37+
def rnd(name: str, n: int, scale: float = 1.0) -> list:
38+
h = 0xCBF29CE484222325
39+
for ch in name.encode():
40+
h = ((h ^ ch) * 0x100000001B3) & 0xFFFFFFFFFFFFFFFF
41+
out = []
42+
for _ in range(n):
43+
h = (h + 0x9E3779B97F4A7C15) & 0xFFFFFFFFFFFFFFFF
44+
z = h
45+
z = ((z ^ (z >> 30)) * 0xBF58476D1CE4E5B9) & 0xFFFFFFFFFFFFFFFF
46+
z = ((z ^ (z >> 27)) * 0x94D049BB133111EB) & 0xFFFFFFFFFFFFFFFF
47+
z ^= z >> 31
48+
out.append(((z >> 11) * (1.0 / 9007199254740992.0) * 2.0 - 1.0) * scale)
49+
return out
50+
51+
52+
def tensor(name: str, shape, scale: float = 1.0) -> torch.Tensor:
53+
n = 1
54+
for d in shape:
55+
n *= d
56+
return torch.tensor(rnd(name, n, scale), dtype=torch.float64).reshape(shape).float()
57+
58+
59+
def load_dit(src: Path):
60+
sys.path.insert(0, str(src.parents[2]))
61+
for name in ("munch",):
62+
if name not in sys.modules:
63+
stub = types.ModuleType(name)
64+
stub.Munch = dict
65+
sys.modules[name] = stub
66+
spec = importlib.util.spec_from_file_location(
67+
"indextts.s2mel.modules.diffusion_transformer", src / "diffusion_transformer.py"
68+
)
69+
m = importlib.util.module_from_spec(spec)
70+
spec.loader.exec_module(m)
71+
return m
72+
73+
74+
def fmt(values) -> str:
75+
lines, row = [], []
76+
for v in values:
77+
row.append(f"{float(v):.9e}F")
78+
if len(row) == 6:
79+
lines.append(" " + ", ".join(row) + ",")
80+
row = []
81+
if row:
82+
lines.append(" " + ", ".join(row) + ",")
83+
return "\n".join(lines)
84+
85+
86+
# Reduced dims. The shipped model is hidden 512 / wavenet 512 / in_channels 80 /
87+
# 8 wavenet layers; the RATIOS that matter (skip_linear takes hidden + in_channels,
88+
# conv2 maps wavenet hidden -> in_channels) are preserved.
89+
#
90+
# WN_HIDDEN MUST EQUAL HIDDEN. `final_layer` is built at the wavenet width but is
91+
# called with `t1`, which the DiT embeds at ITS hidden width, so the wavenet
92+
# final-layer path only composes when the two are equal. They both happen to be
93+
# 512 upstream, which hides the coupling; setting them differently here raised
94+
# `mat1 and mat2 shapes cannot be multiplied (1x8 and 6x12)` from upstream's own
95+
# module. The C++ port asserts it rather than inheriting a silent coincidence.
96+
HIDDEN, WN_HIDDEN, IN_CH, HEADS, DEPTH = 8, 8, 4, 2, 1
97+
STYLE = 6
98+
WN_LAYERS, WN_KERNEL, WN_DILATION, FRAMES = 2, 3, 1, 7
99+
100+
101+
def build_args():
102+
dit = SimpleNamespace(
103+
time_as_token=False, style_as_token=False, uvit_skip_connection=True,
104+
depth=DEPTH, num_heads=HEADS, hidden_dim=HIDDEN, block_size=128,
105+
in_channels=IN_CH, content_type="discrete", content_codebook_size=16,
106+
content_dim=HIDDEN, is_causal=False, final_layer_type="wavenet",
107+
style_condition=True, class_dropout_prob=0.0, long_skip_connection=True,
108+
target="mel", f0_condition=False, n_f0_bins=8, content_codebooks=1,
109+
zero_prompt_speech_token=False, add_resblock_in_transformer=False,
110+
)
111+
wavenet = SimpleNamespace(
112+
hidden_dim=WN_HIDDEN, num_layers=WN_LAYERS, kernel_size=WN_KERNEL,
113+
dilation_rate=WN_DILATION, p_dropout=0.0, style_condition=True,
114+
)
115+
style_encoder = SimpleNamespace(dim=STYLE)
116+
return SimpleNamespace(DiT=dit, wavenet=wavenet, style_encoder=style_encoder)
117+
118+
119+
def main() -> int:
120+
ap = argparse.ArgumentParser()
121+
ap.add_argument("--out", required=True)
122+
a = ap.parse_args()
123+
m = load_dit(Path(os.environ["DIT_SRC"]))
124+
125+
torch.manual_seed(0)
126+
dit = m.DiT(build_args()).eval()
127+
128+
# Every parameter on the tail comes from the shared stream, so the C++ side
129+
# rebuilds them without a fixture.
130+
tail_prefixes = ("cond_projection.", "cond_x_merge_linear.")
131+
with torch.no_grad():
132+
for pname, p in sorted(dit.named_parameters()):
133+
if pname.startswith(tail_prefixes):
134+
p.copy_(tensor("front." + pname, list(p.shape), 0.5))
135+
136+
x = tensor("front.x", [1, IN_CH, FRAMES]) # channel-major, as upstream
137+
prompt_x = tensor("front.prompt_x", [1, IN_CH, FRAMES])
138+
cond = tensor("front.cond", [1, FRAMES, HIDDEN])
139+
style = tensor("front.style", [1, STYLE])
140+
141+
with torch.no_grad():
142+
# ---- upstream diffusion_transformer.py:206-226, verbatim order ----
143+
cond_p = dit.cond_projection(cond)
144+
xt = x.transpose(1, 2)
145+
pt = prompt_x.transpose(1, 2)
146+
x_in = torch.cat([xt, pt, cond_p], dim=-1)
147+
x_in = torch.cat([x_in, style[:, None, :].repeat(1, FRAMES, 1)], dim=-1)
148+
cat864 = x_in.clone()
149+
merged = dit.cond_x_merge_linear(x_in)
150+
151+
# the CFG unconditional branch: everything past in_channels zeroed
152+
x_in_u = cat864.clone()
153+
x_in_u[..., IN_CH:] = x_in_u[..., IN_CH:] * 0
154+
merged_u = dit.cond_x_merge_linear(x_in_u)
155+
# -------------------------------------------------------------------
156+
157+
names = sorted(n for n, _ in dit.named_parameters() if n.startswith(tail_prefixes))
158+
159+
body = [
160+
"// GENERATED by scripts/gen-dit-front-goldens.py -- do not edit.",
161+
"// Oracle: diffusion_transformer.py:243-253 (DiT tail), index-tts",
162+
"// @4f8792ff120cd3ea470dd511e997a17c86cddd10, under the SHIPPED config",
163+
"// long_skip_connection: true, final_layer_type: wavenet.",
164+
"#pragma once",
165+
"",
166+
"#include <cstdint>",
167+
"",
168+
"namespace dit_front_goldens {",
169+
"",
170+
f"inline constexpr int64_t kHidden = {HIDDEN};",
171+
f"inline constexpr int64_t kInChannels = {IN_CH};",
172+
f"inline constexpr int64_t kStyle = {STYLE};",
173+
f"inline constexpr int64_t kFrames = {FRAMES};",
174+
"",
175+
"inline constexpr const char* kParamNames[] = {",
176+
]
177+
body += [f' "front.{n}",' for n in names]
178+
body += [
179+
"};",
180+
"",
181+
"// The 864-wide concatenation before the merge -- [kFrames, 864].",
182+
"inline constexpr float kCat[] = {",
183+
fmt(cat864.reshape(-1).tolist()),
184+
"};",
185+
"",
186+
"// cond_x_merge_linear(cat) -- [kFrames, kHidden].",
187+
"inline constexpr float kMerged[] = {",
188+
fmt(merged.reshape(-1).tolist()),
189+
"};",
190+
"",
191+
"// The CFG UNCONDITIONAL branch: columns past kInChannels zeroed first.",
192+
"inline constexpr float kMergedUncond[] = {",
193+
fmt(merged_u.reshape(-1).tolist()),
194+
"};",
195+
"",
196+
"} // namespace dit_front_goldens",
197+
"",
198+
]
199+
200+
Path(a.out).write_text("\n".join(body))
201+
print(f"wrote {a.out}: {len(names)} front params, merged {tuple(merged.shape)}")
202+
return 0
203+
204+
205+
if __name__ == "__main__":
206+
raise SystemExit(main())
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// S2Mel DiT front end. See dit_front.h for the upstream anchors.
2+
#include "vllm/model_executor/models/dit_front.h"
3+
4+
#include <cstddef>
5+
#include <vector>
6+
7+
#include "vt/dtype.h"
8+
9+
namespace vllm {
10+
namespace models {
11+
namespace dit_front {
12+
13+
std::vector<float> BuildXIn(const Config& cfg, const Weights& w,
14+
const std::vector<float>& x,
15+
const std::vector<float>& prompt_x,
16+
const std::vector<float>& cond,
17+
const std::vector<float>& style, bool unconditional) {
18+
VT_CHECK(cfg.hidden > 0 && cfg.in_channels > 0 && cfg.frames > 0,
19+
"dit_front: hidden, in_channels and frames must be positive");
20+
const int64_t T = cfg.frames;
21+
const int64_t H = cfg.hidden;
22+
const int64_t C = cfg.in_channels;
23+
const int64_t S = cfg.style;
24+
const int64_t wide = C * 2 + H + S;
25+
26+
VT_CHECK(x.size() == static_cast<size_t>(C * T), "dit_front: x must be [in_channels, frames]");
27+
VT_CHECK(prompt_x.size() == static_cast<size_t>(C * T),
28+
"dit_front: prompt_x must be [in_channels, frames]");
29+
VT_CHECK(cond.size() == static_cast<size_t>(T * H), "dit_front: cond must be [frames, hidden]");
30+
VT_CHECK(style.size() == static_cast<size_t>(S), "dit_front: style must be [style]");
31+
VT_CHECK(w.merge_w.size() == static_cast<size_t>(H * wide),
32+
"dit_front: cond_x_merge_linear must be [hidden, 2*in_channels + hidden + style]");
33+
34+
// cond_projection FIRST: the concatenation takes the PROJECTED cond, not the
35+
// raw one. cond_embedder is not consulted -- see the header.
36+
std::vector<float> cond_p(static_cast<size_t>(T * H));
37+
for (int64_t t = 0; t < T; ++t) {
38+
for (int64_t o = 0; o < H; ++o) {
39+
double acc = w.cond_proj_b.empty()
40+
? 0.0
41+
: static_cast<double>(w.cond_proj_b[static_cast<size_t>(o)]);
42+
for (int64_t i = 0; i < H; ++i) {
43+
acc += static_cast<double>(cond[static_cast<size_t>(t * H + i)]) *
44+
static_cast<double>(w.cond_proj_w[static_cast<size_t>(o * H + i)]);
45+
}
46+
cond_p[static_cast<size_t>(t * H + o)] = static_cast<float>(acc);
47+
}
48+
}
49+
50+
// cat([x^T, prompt_x^T, cond, style-over-T], -1), then optionally zero
51+
// everything past in_channels for the unconditional branch.
52+
std::vector<float> cat(static_cast<size_t>(T * wide));
53+
for (int64_t t = 0; t < T; ++t) {
54+
const size_t row = static_cast<size_t>(t * wide);
55+
for (int64_t c = 0; c < C; ++c) {
56+
cat[row + static_cast<size_t>(c)] = x[static_cast<size_t>(c * T + t)];
57+
cat[row + static_cast<size_t>(C + c)] =
58+
unconditional ? 0.0F : prompt_x[static_cast<size_t>(c * T + t)];
59+
}
60+
for (int64_t i = 0; i < H; ++i) {
61+
cat[row + static_cast<size_t>(2 * C + i)] =
62+
unconditional ? 0.0F : cond_p[static_cast<size_t>(t * H + i)];
63+
}
64+
for (int64_t i = 0; i < S; ++i) {
65+
cat[row + static_cast<size_t>(2 * C + H + i)] =
66+
unconditional ? 0.0F : style[static_cast<size_t>(i)];
67+
}
68+
}
69+
70+
std::vector<float> out(static_cast<size_t>(T * H));
71+
for (int64_t t = 0; t < T; ++t) {
72+
for (int64_t o = 0; o < H; ++o) {
73+
double acc =
74+
w.merge_b.empty() ? 0.0 : static_cast<double>(w.merge_b[static_cast<size_t>(o)]);
75+
for (int64_t i = 0; i < wide; ++i) {
76+
acc += static_cast<double>(cat[static_cast<size_t>(t * wide + i)]) *
77+
static_cast<double>(w.merge_w[static_cast<size_t>(o * wide + i)]);
78+
}
79+
out[static_cast<size_t>(t * H + o)] = static_cast<float>(acc);
80+
}
81+
}
82+
return out;
83+
}
84+
85+
} // namespace dit_front
86+
} // namespace models
87+
} // namespace vllm

0 commit comments

Comments
 (0)