Skip to content

Fix undefined symbol error in RWKV-7 l2wrap CUDA kernel (sync v2 kernels with v1 headers)#336

Open
A190nux wants to merge 1 commit into
BlinkDL:mainfrom
A190nux:fix-l2wrap-symbols
Open

Fix undefined symbol error in RWKV-7 l2wrap CUDA kernel (sync v2 kernels with v1 headers)#336
A190nux wants to merge 1 commit into
BlinkDL:mainfrom
A190nux:fix-l2wrap-symbols

Conversation

@A190nux

@A190nux A190nux commented Apr 26, 2026

Copy link
Copy Markdown

Overview

This PR fixes a build-breaking "undefined symbol" error encountered when compiling the custom CUDA operators for RWKV-7.

The Issue

The C++ wrapper (rwkv7_l2wrap_ce_bf16_v1.cpp) expects forward and backward function names suffixed with _v1_cuda. However, the corresponding CUDA implementation (rwkv7_l2wrap_ce_bf16_v1.cu) defined these functions as _v2_cuda. This mismatch prevented the linker from finding the required symbols during the JIT compilation process.

Changes

Renamed l2wrap_ce_forward_v1_cuda to l2wrap_ce_forward_v2_cuda in rwkv7_l2wrap_ce_bf16_v1.cpp.

Renamed l2wrap_ce_backward_v1_cuda to l2wrap_ce_backward_v2_cuda in rwkv7_l2wrap_ce_bf16_v1.cpp.

Validation

Verified that the training script demo-training-prepare-v7-pile.sh now compiles the extensions successfully using ninja and proceeds to model initialization and training without symbol errors.

@BlinkDL

BlinkDL commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Thank you :) I fixed it in latest version too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants