profile
viewpoint

Ask questions[FIRRTL] 70M memory regression in Chipyard test

The chart at the bottom of this page shows a 70M memory regression, we should characterize this.

llvm/circt

Answer questions prithayan

I tried once again, https://github.com/llvm/circt/commit/ca1831b38d8f56cb792b0f4618812400c649f12a vs https://github.com/llvm/circt/commit/b6737713adb1fbd82e2afc6a7da1bce49f322e95 using /usr/bin/time -v tool to measure the max heap usage. which is Maximum resident set size (kbytes): 802396 vs Maximum resident set size (kbytes): 881396 . I used valgrind --tool=massif and it seems the peak usage is in the parser, here's a sample from the output showing the heap allocation and the call stack. The number in brackets is the bytes allocated. I'm going to dig deeper to understand it better. After enabling multithreading::

->41.55% (30,951,864B) 0x770AFD: mlir::Operation::create(mlir::Location, mlir::OperationName, mlir::TypeRange, mlir::ValueRange, mlir::DictionaryAttr, mlir::BlockRange, unsigned int) (mlir/lib/IR/Operation.cpp:136)
| ->41.55% (30,951,864B) 0x771045: mlir::Operation::create(mlir::Location, mlir::OperationName, mlir::TypeRange, mlir::ValueRange, mlir::DictionaryAttr, mlir::BlockRange, mlir::RegionRange) (mlir/lib/IR/Operation.cpp:94)
|   ->41.55% (30,951,864B) 0x770F52: mlir::Operation::create(mlir::OperationState const&) (mlir/lib/IR/Operation.cpp:83)
|     ->41.55% (30,951,864B) 0x6BA092: mlir::OpBuilder::createOperation(mlir::OperationState const&) (mlir/lib/IR/Builders.cpp:400)
|       ->14.05% (10,470,144B) 0x55A4BD: circt::firrtl::SkipOp mlir::OpBuilder::create<circt::firrtl::SkipOp>(mlir::Location) (in /home/prithayanb/release/circt/build/bin/firtool)
|       | ->14.05% (10,470,144B) 0x547911: (anonymous namespace)::FIRStmtParser::parseSkip() (in /home/prithayanb/release/circt/build/bin/firtool)
|       |   ->14.05% (10,470,144B) 0x5416AC: (anonymous namespace)::FIRStmtParser::parseSimpleStmt(unsigned int) (in /home/prithayanb/release/circt/build/bin/firtool)
|       |     ->14.05% (10,470,144B) 0x53EE53: (anonymous namespace)::FIRStmtParser::parseSimpleStmtBlock(unsigned int) (in /home/prithayanb/release/circt/build/bin/firtool)
|       |       ->14.05% (10,470,144B) 0x53BF2D: circt::firrtl::importFIRRTL(llvm::SourceMgr&, mlir::MLIRContext*, circt::firrtl::FIRParserOptions) (in /home/prithayanb/release/circt/build/bin/firtool)
|       |         ->14.05% (10,470,144B) 0x414AD7: executeFirtool(mlir::MLIRContext&) (in /home/prithayanb/release/circt/build/bin/firtool)
|       |           ->14.05% (10,470,144B) 0x41433D: main (in /home/prithayanb/release/circt/build/bin/firtool)
|       |

Before enabling Multithreading::

| ->40.71% (21,312,312B) 0x770FE5: mlir::Operation::create(mlir::Location, mlir::OperationName, mlir::TypeRange, mlir::ValueRange, mlir::DictionaryAttr, mlir::BlockRange, mlir::RegionRange) (mlir/lib/IR/Operation.cpp:94)
|   ->40.71% (21,312,312B) 0x770EF2: mlir::Operation::create(mlir::OperationState const&) (mlir/lib/IR/Operation.cpp:83)
|     ->40.71% (21,312,312B) 0x6BA032: mlir::OpBuilder::createOperation(mlir::OperationState const&) (mlir/lib/IR/Builders.cpp:400)
|       ->14.68% (7,686,976B) 0x55A45D: circt::firrtl::SkipOp mlir::OpBuilder::create<circt::firrtl::SkipOp>(mlir::Location) (in /home/prithayanb/release/circt/build/bin/firtool)
|       | ->14.68% (7,686,976B) 0x5478B1: (anonymous namespace)::FIRStmtParser::parseSkip() (in /home/prithayanb/release/circt/build/bin/firtool)
|       |   ->14.68% (7,686,976B) 0x54164C: (anonymous namespace)::FIRStmtParser::parseSimpleStmt(unsigned int) (in /home/prithayanb/release/circt/build/bin/firtool)
|       |     ->14.68% (7,686,976B) 0x53EDF3: (anonymous namespace)::FIRStmtParser::parseSimpleStmtBlock(unsigned int) (in /home/prithayanb/release/circt/build/bin/firtool)
|       |       ->14.68% (7,686,976B) 0x53BECD: circt::firrtl::importFIRRTL(llvm::SourceMgr&, mlir::MLIRContext*, circt::firrtl::FIRParserOptions) (in /home/prithayanb/release/circt/build/bin/firtool)
|       |         ->14.68% (7,686,976B) 0x414AFA: executeFirtool(mlir::MLIRContext&) (in /home/prithayanb/release/circt/build/bin/firtool)
|       |           ->14.68% (7,686,976B) 0x41433D: main (in /home/prithayanb/release/circt/build/bin/firtool)
useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List