Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSAN race in XLA:CPU inside onednn #20686

Open
hawkinsp opened this issue Dec 18, 2024 · 0 comments
Open

TSAN race in XLA:CPU inside onednn #20686

hawkinsp opened this issue Dec 18, 2024 · 0 comments
Assignees
Labels
CPU Related to XLA on CPU

Comments

@hawkinsp
Copy link
Member

I suspect onednn is not handling flags in a thread-safe way?

WARNING: ThreadSanitizer: data race (pid=502169)
  Read of size 1 at 0x7f3baeee22cc by thread T314:
    #0 dnnl::impl::setting_t<unsigned int>::initialized() /proc/self/cwd/external/onednn/src/common/utils.hpp:681:33 (xla_extension.so+0x4b2c171) (BuildId: ee9c291a11390fc5)
    #1 dnnl::impl::get_verbose(dnnl::impl::verbose_t::flag_kind, dnnl::impl::component_t::flag_kind) /proc/self/cwd/external/onednn/src/common/verbose.cpp:161:18 (xla_extension.so+0x4b2c171)
    #2 dnnl_sgemm /proc/self/cwd/external/onednn/src/common/gemm.cpp:102:5 (xla_extension.so+0x4a1b064) (BuildId: ee9c291a11390fc5)
    #3 Eigen::internal::dnnl_gemm_kernel<float, long, Eigen::internal::blas_data_mapper<float, long, 0, 0, 1>, false, false>::operator()(Eigen::internal::blas_data_mapper<float, long, 0, 0, 1> const&, float const*, float const*, long, long, long, float, float, int, int, char, char) /proc/self/cwd/external/xla/xla/tsl/framework/contraction/eigen_contraction_kernel.h:171:9 (xla_extension.so+0x32505cb) (BuildId: ee9c291a11390fc5)
    #4 Eigen::internal::TensorContractionKernel<float, float, float, long, Eigen::internal::blas_data_mapper<float, long, 0, 0, 1>, Eigen::internal::TensorContractionInputMapper<float, long, 1, Eigen::TensorEvaluator<Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::ThreadPoolDevice>, std::array<long, 1ul>, std::array<long, 1ul>, 8, true, false, 0, Eigen::MakePointer>, Eigen::internal::TensorContractionInputMapper<float, long, 0, Eigen::TensorEvaluator<Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::ThreadPoolDevice>, std::array<long, 1ul>, std::array<long, 1ul>, 8, false, false, 0, Eigen::MakePointer>>::invoke(Eigen::internal::blas_data_mapper<float, long, 0, 0, 1> const&, Eigen::internal::ColMajorBlock<float, long> const&, Eigen::internal::ColMajorBlock<float, long> const&, long, long, long, float, float) /proc/self/cwd/external/xla/xla/tsl/framework/contraction/eigen_contraction_kernel.h:894:1 (xla_extension.so+0x40aeb10) (BuildId: ee9c291a11390fc5)
    #5 void Eigen::TensorContractionEvaluatorBase<Eigen::TensorEvaluator<Eigen::TensorContractionOp<std::array<Eigen::IndexPair<long>, 1ul> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::NoOpOutputKernel const> const, Eigen::ThreadPoolDevice>>::evalGemmPartial<true, false, false, 0, true>(float*, long, long, int) const /proc/self/cwd/external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:849:18 (xla_extension.so+0x40b8ff6) (BuildId: ee9c291a11390fc5)
    #6 void Eigen::TensorContractionEvaluatorBase<Eigen::TensorEvaluator<Eigen::TensorContractionOp<std::array<Eigen::IndexPair<long>, 1ul> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::NoOpOutputKernel const> const, Eigen::ThreadPoolDevice>>::evalGemm<true, false, false, 0>(float*) const /proc/self/cwd/external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:746:20 (xla_extension.so+0x409e472) (BuildId: ee9c291a11390fc5)
    #7 void Eigen::TensorContractionEvaluatorBase<Eigen::TensorEvaluator<Eigen::TensorContractionOp<std::array<Eigen::IndexPair<long>, 1ul> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::NoOpOutputKernel const> const, Eigen::ThreadPoolDevice>>::evalProductSequential<true, false, false, 0>(float*) const /proc/self/cwd/external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:689:22 (xla_extension.so+0x409e472)

  Previous write of size 1 at 0x7f3baeee22cc by thread T312:
    #0 dnnl::impl::setting_t<unsigned int>::set(unsigned int) /proc/self/cwd/external/onednn/src/common/utils.hpp:685:22 (xla_extension.so+0x4b2db1a) (BuildId: ee9c291a11390fc5)
    #1 dnnl::impl::get_verbose(dnnl::impl::verbose_t::flag_kind, dnnl::impl::component_t::flag_kind) /proc/self/cwd/external/onednn/src/common/verbose.cpp:261:17 (xla_extension.so+0x4b2db1a)
    #2 dnnl_sgemm /proc/self/cwd/external/onednn/src/common/gemm.cpp:102:5 (xla_extension.so+0x4a1b064) (BuildId: ee9c291a11390fc5)
    #3 Eigen::internal::dnnl_gemm_kernel<float, long, Eigen::internal::blas_data_mapper<float, long, 0, 0, 1>, false, false>::operator()(Eigen::internal::blas_data_mapper<float, long, 0, 0, 1> const&, float const*, float const*, long, long, long, float, float, int, int, char, char) /proc/self/cwd/external/xla/xla/tsl/framework/contraction/eigen_contraction_kernel.h:171:9 (xla_extension.so+0x32505cb) (BuildId: ee9c291a11390fc5)
    #4 Eigen::internal::TensorContractionKernel<float, float, float, long, Eigen::internal::blas_data_mapper<float, long, 0, 0, 1>, Eigen::internal::TensorContractionInputMapper<float, long, 1, Eigen::TensorEvaluator<Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::ThreadPoolDevice>, std::array<long, 1ul>, std::array<long, 1ul>, 8, true, false, 0, Eigen::MakePointer>, Eigen::internal::TensorContractionInputMapper<float, long, 0, Eigen::TensorEvaluator<Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::ThreadPoolDevice>, std::array<long, 1ul>, std::array<long, 1ul>, 8, false, false, 0, Eigen::MakePointer>>::invoke(Eigen::internal::blas_data_mapper<float, long, 0, 0, 1> const&, Eigen::internal::ColMajorBlock<float, long> const&, Eigen::internal::ColMajorBlock<float, long> const&, long, long, long, float, float) /proc/self/cwd/external/xla/xla/tsl/framework/contraction/eigen_contraction_kernel.h:894:1 (xla_extension.so+0x40aeb10) (BuildId: ee9c291a11390fc5)
    #5 void Eigen::TensorContractionEvaluatorBase<Eigen::TensorEvaluator<Eigen::TensorContractionOp<std::array<Eigen::IndexPair<long>, 1ul> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::NoOpOutputKernel const> const, Eigen::ThreadPoolDevice>>::evalGemmPartial<true, false, false, 0, true>(float*, long, long, int) const /proc/self/cwd/external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:849:18 (xla_extension.so+0x40b8ff6) (BuildId: ee9c291a11390fc5)
    #6 void Eigen::TensorContractionEvaluatorBase<Eigen::TensorEvaluator<Eigen::TensorContractionOp<std::array<Eigen::IndexPair<long>, 1ul> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::NoOpOutputKernel const> const, Eigen::ThreadPoolDevice>>::evalGemm<true, false, false, 0>(float*) const /proc/self/cwd/external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:746:20 (xla_extension.so+0x409e472) (BuildId: ee9c291a11390fc5)
    #7 void Eigen::TensorContractionEvaluatorBase<Eigen::TensorEvaluator<Eigen::TensorContractionOp<std::array<Eigen::IndexPair<long>, 1ul> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 0, long>, 16, Eigen::MakePointer> const, Eigen::NoOpOutputKernel const> const, Eigen::ThreadPoolDevice>>::evalProductSequential<true, false, false, 0>(float*) const /proc/self/cwd/external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:689:22 (xla_extension.so+0x409e472)
@hawkinsp hawkinsp added the CPU Related to XLA on CPU label Dec 18, 2024
@hawkinsp hawkinsp assigned penpornk and unassigned ezhulenev Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CPU Related to XLA on CPU
Projects
None yet
Development

No branches or pull requests

3 participants