From 26ba7be0fa00587f6eaea78d64e8ac73c08e8177 Mon Sep 17 00:00:00 2001 From: Phuong Nguyen Date: Wed, 11 Dec 2024 14:49:06 -0800 Subject: [PATCH] add thread_local for norm registry instance Signed-off-by: Phuong Nguyen --- transformer_engine/common/normalization/common.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/transformer_engine/common/normalization/common.h b/transformer_engine/common/normalization/common.h index 8a8df63ba4..d1d56d5cc9 100644 --- a/transformer_engine/common/normalization/common.h +++ b/transformer_engine/common/normalization/common.h @@ -287,9 +287,8 @@ class CudnnNormalizationPlan : public NormalizationPlanBase { class NormalizationPlanRegistry { public: - // TODO thread-safe static NormalizationPlanRegistry& getInstance() { - static NormalizationPlanRegistry instance; + static thread_local NormalizationPlanRegistry instance; return instance; }