[PyTorchPipeline] Rename from scalehls-pipeline to scalehls-pytorch-pipeline; [QoREstimation] Remove the depAnalysis option, always set to true

This commit is contained in:
Hanchen Ye 2022-02-23 17:09:09 -06:00
parent a4e1d05626
commit 02dcdd1438
6 changed files with 8 additions and 15 deletions

View File

@ -73,7 +73,7 @@ $ python3 export_resnet18_mlir.py | torch-mlir-opt \
$ # Optimize the model and emit C++ code.
$ # This may take several minutes to compile due to the large amount of weights.
$ scalehls-opt resnet18.mlir \
-scalehls-pipeline="top-func=forward opt-level=2 frontend=torch" \
-scalehls-pytorch-pipeline="top-func=forward opt-level=2 frontend=torch" \
| scalehls-translate -emit-hlscpp > resnet18.cpp
```

View File

@ -75,7 +75,7 @@ std::unique_ptr<Pass> createLoopPipeliningPass();
std::unique_ptr<Pass> createArrayPartitionPass();
std::unique_ptr<Pass> createCreateHLSCppPrimitivePass();
void registerScaleHLSPassPipeline();
void registerScaleHLSPyTorchPipeline();
void registerTransformsPasses();
#define GEN_PASS_CLASSES

View File

@ -27,10 +27,7 @@ def QoREstimation : Pass<"qor-estimation", "ModuleOp"> {
let options = [
Option<"targetSpec", "target-spec", "std::string",
/*default=*/"\"./target-spec.ini\"",
"File path: target backend specifications and configurations">,
Option<"depAnalysis", "dep-analysis", "bool", /*default=*/"true",
"Whether a comprehensive dependency analysis is conducted">
"File path: target backend specifications and configurations">
];
}
@ -58,10 +55,7 @@ def MultipleLevelDSE : Pass<"dse", "ModuleOp"> {
Option<"targetSpec", "target-spec", "std::string",
/*default=*/"\"./target-spec.ini\"",
"File path: target backend specifications and configurations">,
Option<"depAnalysis", "dep-analysis", "bool", /*default=*/"true",
"Whether a comprehensive dependency analysis is conducted">
"File path: target backend specifications and configurations">
];
}

View File

@ -888,7 +888,7 @@ struct MultipleLevelDSE : public MultipleLevelDSEBase<MultipleLevelDSE> {
maxDspNum = UINT_MAX;
// Initialize an performance and resource estimator.
auto estimator = ScaleHLSEstimator(latencyMap, dspUsageMap, depAnalysis);
auto estimator = ScaleHLSEstimator(latencyMap, dspUsageMap, true);
auto optimizer = ScaleHLSOptimizer(
estimator, outputNum, maxDspNum, maxInitParallel, maxExplParallel,
maxLoopParallel, maxIterNum, maxDistance);

View File

@ -22,9 +22,9 @@ namespace {
#include "scalehls/Transforms/Passes.h.inc"
} // namespace
void scalehls::registerScaleHLSPassPipeline() {
void scalehls::registerScaleHLSPyTorchPipeline() {
PassPipelineRegistration<ScaleHLSOptions>(
"scalehls-pipeline", "Compile to HLS C++",
"scalehls-pytorch-pipeline", "Compile TOSA (from Torch-MLIR) to HLS C++",
[](OpPassManager &pm, const ScaleHLSOptions &opts) {
unsigned dataflowGran = 0;
unsigned loopUnrollSize = 0;

View File

@ -983,8 +983,7 @@ struct QoREstimation : public scalehls::QoREstimationBase<QoREstimation> {
for (auto func : module.getOps<FuncOp>())
if (auto funcDirect = getFuncDirective(func))
if (funcDirect.getTopFunc())
ScaleHLSEstimator(latencyMap, dspUsageMap, depAnalysis)
.estimateFunc(func);
ScaleHLSEstimator(latencyMap, dspUsageMap, true).estimateFunc(func);
}
};
} // namespace