masahi commented on code in PR #13050:
URL: https://github.com/apache/tvm/pull/13050#discussion_r995426149


##########
src/meta_schedule/database/database.cc:
##########
@@ -59,12 +60,8 @@ Workload Workload::FromJSON(const ObjectRef& json_obj) {
       String b64_mod = Downcast<String>(json_array->at(1));
       std::string json_mod = Base64Decode(b64_mod);
       mod = Downcast<IRModule>(LoadJSON(json_mod));
+      std::stringstream(str_shash) >> shash;
     }
-    // Verify SHash(mod) == shash
-    shash = tvm::StructuralHash()(mod);
-    String recalc_shash = SHash2Str(shash);
-    CHECK_EQ(recalc_shash, str_shash) << "ValueError: Structural hash changed. 
Given: " << str_shash
-                                      << "; Recalculated: " << recalc_shash;

Review Comment:
   To keep things clean, I want to minimize the number of unique 
`ModuleEquality` instances scattered throughout MS infra. Currently, only task 
extraction and `Database` "own" a `ModuleEquality` instance.
   
   Given this goal, I think having `Database` compute a hash of `Workload` 
using its `ModuleEquality` is more natural than passing `mod_eq_name` to 
`Workload` and let it compute hash. Moreover, all `Workload` would end up 
having the same `mod_eq_name`, so it feels redundant.  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to