[BUG] Inactive layer1x1 drops the activation from the WaveNet residual path
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp
調査の方向性
Start in NAM/wavenet/model.cpp at _Layer::Process and inspect the inactive-layer1x1 branch in both the Eigen and NAM_USE_INLINE_GEMM paths. Compare its residual handling with nam/models/wavenet/_layer_array.py, lines 755–773, where the trainer adds post_activation to x. Done means the core output matches the trainer for an inactive layer1x1 model, including the reported residual-path comparison.
索引モデルが issue の本文から書いたものです。
説明
Summary
When a WaveNet layer has "layer1x1": {"active": false} (.nam 0.7 format), the core passes the residual input through unchanged instead of adding the layer's activation output to it. The trainer (neural-amp-modeler) computes x + post_activation in that case, so the core's output diverges from the trainer's for such models.
Where
- Core (
main@ 0b3d3c97b0, also v0.5.4):NAM/wavenet/model.cpp,_Layer::Process…inactive-layer1x1branch (around line 385):// If layer1x1 is inactive, residual connection is just the input (identity) ...memcpy(... input.data() ...) // NAM_USE_INLINE_GEMM path this->_output_next_layer.leftCols(num_frames).noalias() = input.leftCols(num_frames); // Eigen path - Trainer (
main@ 0072676419):nam/models/wavenet/_layer_array.py, lines ~755–773:
i.e. withlayer_output = post_activation if self._layer1x1 is not None: layer_output = self._layer1x1(layer_output) ... residual = x[:, :, -layer_output.shape[2]:] + layer_outputlayer1x1inactive the residual isx + post_activation, notx.
Impact
On a model exported by neural-amp-modeler 0.13.0 with layer1x1 inactive on one layer array, the core's output differed from the trainer's PyTorch output (pad_start=True) by up to ~0.4 on that array and ~1.9e-3 at the model output. With the residual add restored, the core matches the trainer to ~6e-8.
Suggested fix
In the inactive branch, add the activation output (the bottleneck rows of _z) to the input instead of copying it, in both the Eigen path and the NAM_USE_INLINE_GEMM path, e.g. for the Eigen path:
this->_output_next_layer.leftCols(num_frames).noalias() =
input.leftCols(num_frames) + this->_z.topRows(bottleneck).leftCols(num_frames);
(Assuming bottleneck == channels is required when layer1x1 is inactive, as the residual shapes imply.)
- 主要言語
- C++
- スター
- 955
- フォーク
- 183
- 平均マージ
- 36分
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sdatkinson/NeuralAmpModelerCore のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sdatkinson/NeuralAmpModelerCore#342 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
sdatkinson/NeuralAmpModelerCore#328 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
sdatkinson/NeuralAmpModelerCore#305 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
sdatkinson/NeuralAmpModelerCore#304 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
sdatkinson/NeuralAmpModelerCore#327 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
sdatkinson/NeuralAmpModelerCore の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mpfaffenberger/privateer_reimagined#658 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
microsoft/onnxruntime#33018 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
AXERA-TECH/ax-llm#81 ·
-
enhancement
難易度 2/5 半日 初心者へのやさしさ 78/100
ros-industrial/ros2_canopen#448 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信