This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch refactor-s3
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit b5d5d6c398cbc67dec03d25debbb3be39713a574
Author: tqchen <[email protected]>
AuthorDate: Mon May 5 09:35:15 2025 -0400

    [WIN] Remove lock to avoid mutex dep at init time
---
 src/node/attr_registry.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/node/attr_registry.h b/src/node/attr_registry.h
index 2b022d3e45..12913ccefd 100644
--- a/src/node/attr_registry.h
+++ b/src/node/attr_registry.h
@@ -28,7 +28,6 @@
 #include <tvm/runtime/packed_func.h>
 
 #include <memory>
-#include <mutex>
 #include <unordered_map>
 #include <utility>
 #include <vector>
@@ -95,7 +94,6 @@ class AttrRegistry {
    */
   void UpdateAttr(const String& attr_name, const KeyType& key, Any value, int 
plevel) {
     using runtime::TVMRetValue;
-    std::lock_guard<std::mutex> lock(mutex_);
     auto& op_map = attrs_[attr_name];
     if (op_map == nullptr) {
       op_map.reset(new AttrRegistryMapContainerMap<KeyType>());
@@ -122,7 +120,6 @@ class AttrRegistry {
    * \param key The key to the attribute table.
    */
   void ResetAttr(const String& attr_name, const KeyType& key) {
-    std::lock_guard<std::mutex> lock(mutex_);
     auto& op_map = attrs_[attr_name];
     if (op_map == nullptr) {
       return;
@@ -139,7 +136,6 @@ class AttrRegistry {
    * \return The result attribute map.
    */
   const AttrRegistryMapContainerMap<KeyType>& GetAttrMap(const String& 
attr_name) {
-    std::lock_guard<std::mutex> lock(mutex_);
     auto it = attrs_.find(attr_name);
     if (it == attrs_.end()) {
       LOG(FATAL) << "Attribute \'" << attr_name << "\' is not registered";
@@ -153,7 +149,6 @@ class AttrRegistry {
    * \return The check result.
    */
   bool HasAttrMap(const String& attr_name) {
-    std::lock_guard<std::mutex> lock(mutex_);
     return attrs_.count(attr_name);
   }
 
@@ -166,8 +161,6 @@ class AttrRegistry {
   }
 
  private:
-  // mutex to avoid registration from multiple threads.
-  std::mutex mutex_;
   // entries in the registry
   std::vector<std::unique_ptr<EntryType>> entries_;
   // map from name to entries.

Reply via email to