You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by an...@apache.org on 2022/07/18 16:44:24 UTC

[tvm] branch main updated: [AUTOSCHEDULER,FIX] Calculate arithmetic intensity without log scale (#12079)

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

andrewzhaoluo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new d43ffa9099 [AUTOSCHEDULER,FIX] Calculate arithmetic intensity without log scale (#12079)
d43ffa9099 is described below

commit d43ffa9099c74f75c18f76cfc673bcffbbcfaacd
Author: Tristan Konolige <tk...@octoml.ai>
AuthorDate: Mon Jul 18 09:44:18 2022 -0700

    [AUTOSCHEDULER,FIX] Calculate arithmetic intensity without log scale (#12079)
    
    * [AUTOSCHEDULER,FIX] Calculate arithmetic intensity without log scale
    
    In autoscheduler's featurization, arithmetic intensity was incorrectly
    calculated as log(FLOPs) / log(bytes). This change removes the logs so
    arithmetic intensity is FLOPs / bytes.
    
    * slog arith inten
---
 src/auto_scheduler/feature.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/auto_scheduler/feature.cc b/src/auto_scheduler/feature.cc
index bf6fce8978..ab60aef9ae 100644
--- a/src/auto_scheduler/feature.cc
+++ b/src/auto_scheduler/feature.cc
@@ -884,9 +884,9 @@ class PerStoreFeatureExtractor : public StmtExprVisitor {
         mem_bytes += touched_size * buffer_dtypes.at(t).bytes();
       }
 
-      mem_bytes_list->push_back(std::log2(mem_bytes));
+      mem_bytes_list->push_back(mem_bytes);
       *cur_compute_ops *= GetLoopExtent(for_loop_stack_[i], local_analyzer);
-      compute_ops_list->push_back(std::log2(*cur_compute_ops));
+      compute_ops_list->push_back(*cur_compute_ops);
     }
 
     //  Buffer access related features (per buffer)
@@ -1232,7 +1232,7 @@ void GetPerStoreFeature(const PrimFunc& func, int cache_line_size, int max_n_buf
 
     /***** Group 3: Arithmetic intensity related features *****/
     for (size_t i = 0; i < ARITH_INTENSITY_CURVE_SAMPLE_N; ++i) {
-      ret->push_back(fea_set.arith_intensity_curve[i]);
+      ret->push_back(slog(fea_set.arith_intensity_curve[i]));
     }
 
     /***** Group 4: Allocation related features *****/