Skip to content

Commit

Permalink
Adding autokcache base.
Browse files Browse the repository at this point in the history
  • Loading branch information
thaisacs committed Apr 23, 2024
1 parent b0143d1 commit 23a6530
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ tvm_file_glob(GLOB_RECURSE COMPILER_SRCS
src/arith/*.cc
src/te/*.cc
src/autotvm/*.cc
src/autokcache/*.cc
src/tir/*.cc
src/topi/*.cc
src/driver/*.cc
Expand Down
3 changes: 3 additions & 0 deletions src/auto_scheduler/search_policy/sketch_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <tvm/runtime/registry.h>
#include <tvm/support/parallel_for.h>

#include "../../autokcache/load_states.h"

#include <algorithm>
#include <iomanip>
#include <limits>
Expand Down Expand Up @@ -295,6 +297,7 @@ Array<State> SketchPolicyNode::SearchOneRound(int num_random_states, Array<State
sketch_cache_ = GenerateSketches();
}

tvm::autokcache::load_file();
// 2. Sample the init population
Array<State> init_population = SampleInitPopulation(sketch_cache_);

Expand Down
17 changes: 17 additions & 0 deletions src/autokcache/load_states.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "load_states.h"

#include <fstream>
#include <iostream>
#include <string>

namespace tvm {
namespace autokcache {

void load_file() {
std::cout << "I have to change it..." << std::endl;
//std::cout << "here..." << std::endl;
//std::string file = "/home/thais/Dev/tvm-scripts/operator-dataset-30/matmul_add/1024-1024-1024-0.log";
}

} // namespace autokcache
} // namespace tvm
20 changes: 20 additions & 0 deletions src/autokcache/load_states.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef LOAD_STATES_H
#define LOAD_STATES_H

#include <tvm/arith/analyzer.h>
#include <tvm/auto_scheduler/auto_schedule.h>
#include <tvm/auto_scheduler/measure.h>
#include <tvm/auto_scheduler/search_policy.h>
#include <tvm/runtime/registry.h>
#include <tvm/tir/builtin.h>
#include <tvm/tir/expr_functor.h>

namespace tvm {
namespace autokcache {

void load_file();

} // namespace autokcache
} // namespace tvm

#endif

0 comments on commit 23a6530

Please sign in to comment.