Skip to content

[Bug] Check failed: data_type_v<T> == dtype_ (f16 vs. bf16) #4686

Description

@zwx1225059

Checklist

  • 1. I have searched related issues but cannot get the expected help.
  • 2. The bug has not been fixed in the latest version.
  • 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.

Describe the bug

gpt-oss-120b cannot be deployed using version 0.14.0a1. Other models can be deployed normally, and other versions, such as 0.13.0, are normal. The following is the error log.
[TM][WARN][0616.14:35:12.059571][SequenceManager.cc:145] prefix caching is enabled
[TM][WARN][0616.14:35:12.067487][SequenceManager.cc:145] prefix caching is enabled
[TM][WARN][0616.14:35:12.071696][SequenceManager.cc:145] prefix caching is enabled
[TM][WARN][0616.14:35:12.074386][anomaly_handler.cu:141] level: 2
[TM][WARN][0616.14:35:12.074417][anomaly_handler.cu:163] +INF -> 65504
[TM][WARN][0616.14:35:12.074423][anomaly_handler.cu:164] -INF -> -65504
[TM][WARN][0616.14:35:12.074428][anomaly_handler.cu:170] NaN -> 0
[TM][WARN][0616.14:35:12.079330][anomaly_handler.cu:200] fallback: 0
[TM][WARN][0616.14:35:12.079376][anomaly_handler.cu:206] max_batch_size: 1000
[TM][WARN][0616.14:35:12.079393][anomaly_handler.cu:207] vocab_size: 1000
[TM][WARN][0616.14:35:12.079377][anomaly_handler.cu:200] fallback: 0
[TM][WARN][0616.14:35:12.079421][anomaly_handler.cu:206] max_batch_size: 1000
[TM][WARN][0616.14:35:12.079429][anomaly_handler.cu:207] vocab_size: 1000
[TM][WARN][0616.14:35:12.081156][anomaly_handler.cu:200] fallback: 0
[TM][WARN][0616.14:35:12.081188][anomaly_handler.cu:206] max_batch_size: 1000
[TM][WARN][0616.14:35:12.081194][anomaly_handler.cu:207] vocab_size: 1000
[TM][WARN][0616.14:35:12.081232][anomaly_handler.cu:200] fallback: 0
[TM][WARN][0616.14:35:12.081263][anomaly_handler.cu:206] max_batch_size: 1000
[TM][WARN][0616.14:35:12.081271][anomaly_handler.cu:207] vocab_size: 1000
[TM][FATAL][0616.14:35:12.201524][buffer.h:58] Check failed: data_type_v == dtype_ (f16 vs. bf16)
[TM][FATAL][0616.14:35:12.201555][buffer.h:58] Check failed: data_type_v == dtype_ (f16 vs. bf16)
*** stacktrace of thread 0x7f64a97fa700 ***
[ 0] TM_CHECK @ buffer.h:58
[ 1] MoeFfnLayer::Forward() @ moe_ffn_layer.cc:66
[ 2] layer_0 @ unified_decoder.cc:237
[ 3] UnifiedDecoder::Forward() @ unified_decoder.cc:161
[ 4] LanguageModel::Impl::Forward() @ language_model.cc:393
[ 5] ModelExecutor::Impl::Run() @ model_executor.cc:59
[ 6] ModelExecutor::Impl::InternalThreadEntry() @ model_executor.cc:35
[TM][FATAL][0616.14:35:12.201596][buffer.h:58] Check failed: data_type_v == dtype_ (f16 vs. bf16)
*** stacktrace of thread 0x7f64a9ffb700 ***
[ 0] TM_CHECK @ buffer.h:58
[ 1] MoeFfnLayer::Forward() @ moe_ffn_layer.cc:66
[ 2] layer_0 @ unified_decoder.cc:237
[ 3] UnifiedDecoder::Forward() @ unified_decoder.cc:161
[ 4] LanguageModel::Impl::Forward() @ language_model.cc:393
[ 5] ModelExecutor::Impl::Run() @ model_executor.cc:59
[ 6] ModelExecutor::Impl::InternalThreadEntry() @ model_executor.cc:35
*** stacktrace of thread 0x7f64aaffd700 ***
[ 0] TM_CHECK @ buffer.h:58
[ 1] MoeFfnLayer::Forward() @ moe_ffn_layer.cc:66
[ 2] layer_0 @ unified_decoder.cc:237
[ 3] UnifiedDecoder::Forward() @ unified_decoder.cc:161
[ 4] LanguageModel::Impl::Forward() @ language_model.cc:393
[ 5] ModelExecutor::Impl::Run() @ model_executor.cc:59
[ 6] ModelExecutor::Impl::InternalThreadEntry() @ model_executor.cc:35
[TM][FATAL][0616.14:35:12.201692][buffer.h:58] Check failed: data_type_v == dtype_ (f16 vs. bf16)
*** stacktrace of thread 0x7f64aa7fc700 ***
[ 0] TM_CHECK @ buffer.h:58
[ 1] MoeFfnLayer::Forward() @ moe_ffn_layer.cc:66
[ 2] layer_0 @ unified_decoder.cc:237
[ 3] UnifiedDecoder::Forward() @ unified_decoder.cc:161
[ 4] LanguageModel::Impl::Forward() @ language_model.cc:393
[ 5] ModelExecutor::Impl::Run() @ model_executor.cc:59
[ 6] ModelExecutor::Impl::InternalThreadEntry() @ model_executor.cc:35
./start_lmdeploy_oss-120b.sh: line 22: 3842712 Aborted (core dumped) lmdeploy serve api_server openai/gpt-oss-120b --server-port 8000 --backend turbomind --model-name gpt-oss-120b --enable-prefix-caching --cache-max-entry-count 0.90 --enable-prefix-caching --tp 4 --communicator native --log-level WARNING --max-log-len 200

Reproduction

mdeploy serve api_server openai/gpt-oss-120b --server-port 8000 --backend turbomind --model-name gpt-oss-120b --enable-prefix-caching --cache-max-entry-count 0.90 --enable-prefix-caching --tp 4 --communicator native --log-level WARNING --max-log-len 200

Environment

sys.platform: linux
Python: 3.12.0 | packaged by Anaconda, Inc. | (main, Oct  2 2023, 17:29:18) [GCC 11.2.0]
CUDA available: True
MUSA available: False
numpy_random_seed: 2147483648
GPU 0,1,2,3: Tesla V100-PCIE-32GB
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 12.1, V12.1.66
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.3) 9.4.0
PyTorch: 2.10.0+cu128
PyTorch compiling details: PyTorch built with:
  - GCC 13.3
  - C++ Version: 201703
  - Intel(R) oneAPI Math Kernel Library Version 2024.2-Product Build 20240605 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v3.7.1 (Git Hash 8d263e693366ef8db40acc569cc7d8edf644556d)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX512
  - CUDA Runtime 12.8
  - NVCC architecture flags: -gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_90,code=sm_90;-gencode;arch=compute_100,code=sm_100;-gencode;arch=compute_120,code=sm_120
  - CuDNN 91.0.2  (built against CUDA 12.9)
  - Magma 2.6.1
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, COMMIT_SHA=449b1768410104d3ed79d3bcfe4ba1d65c7f22c0, CUDA_VERSION=12.8, CUDNN_VERSION=9.10.2, CXX_COMPILER=/opt/rh/gcc-toolset-13/root/usr/bin/c++, CXX_FLAGS= -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DLIBKINETO_NOXPUPTI=ON -DUSE_FBGEMM -DUSE_FBGEMM_GENAI -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -DC10_NODEPRECATED -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=range-loop-construct -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-unknown-pragmas -Wno-unused-parameter -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=old-style-cast -faligned-new -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-dangling-reference -Wno-error=dangling-reference -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, TORCH_VERSION=2.10.0, USE_CUDA=ON, USE_CUDNN=ON, USE_CUSPARSELT=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_GLOO=ON, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=1, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF, USE_XCCL=OFF, USE_XPU=OFF,

TorchVision: 0.25.0+cu128
LMDeploy: 0.14.0a1+
transformers: 5.12.1
fastapi: 0.135.1
pydantic: 2.12.5
triton: 3.6.0
NVIDIA Topology:
        GPU0    GPU1    GPU2    GPU3    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      PIX     PIX     PIX     0-17,36-53      0               N/A
GPU1    PIX      X      PIX     PIX     0-17,36-53      0               N/A
GPU2    PIX     PIX      X      PIX     0-17,36-53      0               N/A
GPU3    PIX     PIX     PIX      X      0-17,36-53      0               N/A

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

Error traceback

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions