Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 579349096
Change-Id: Ieff86598351a0d9a614299fe77d8b0db2f2559ed
  • Loading branch information
lishanok authored and copybara-github committed Nov 4, 2023
1 parent f55d93f commit c5051b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from qkeras.qtools import qgraph
from qkeras.qtools import qtools_util
from qkeras.qtools import generate_layer_data_type_map
from qkeras.qtools import dnc_layer_cost_ace
from qkeras.qtools.DnC import dnc_layer_cost_ace


class CostMode(enum.Enum):
Expand Down Expand Up @@ -262,10 +262,13 @@ def get_per_layer_cost(layer_quantizer_bitwidth, layer_mac_count, layer_shapes,
wbit=layer_quantizer_bitwidth["weight_bits"],
abit=layer_quantizer_bitwidth["acc_bits"],
regen_params=False)
pe_area = (mac_gates * layer_mac_count * cin_unroll * cout_unroll *
kh_unroll * kw_unroll)

# pe_area is not dependent on total num of MACs in the layer.
pe_area = (mac_gates * cin_unroll * cout_unroll * kh_unroll * kw_unroll)

# Memory includes input, output and weight memory, translated to gates.
# TODO(lishanok@): weights could be stored in either SRAM or ROM, dependent
# on user specification.
memory_area = (
InElementPerClk * layer_quantizer_bitwidth["input_bits"] *
dnc_layer_cost_ace.MemoryGatesPerBit["Register"] +
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/qtools_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from qkeras.utils import model_save_quantized_weights
from qkeras.qtools.quantized_operators import adder_impl
from qkeras.qtools.quantized_operators import quantizer_impl
from qkeras.qtools import divide_and_conquer
from qkeras.qtools.DnC import divide_and_conquer


def qdense_model_fork():
Expand Down

0 comments on commit c5051b5

Please sign in to comment.