aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/architecture_features.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/architecture_features.py')
-rw-r--r--ethosu/vela/architecture_features.py23
1 files changed, 5 insertions, 18 deletions
diff --git a/ethosu/vela/architecture_features.py b/ethosu/vela/architecture_features.py
index 9f27b7ed..64005bf5 100644
--- a/ethosu/vela/architecture_features.py
+++ b/ethosu/vela/architecture_features.py
@@ -510,12 +510,9 @@ class ArchitectureFeatures:
start_coord[1] + ifm_block.height,
start_coord[2] + ifm_block.depth,
)
-
return (start_coord, end_coord, 1) # start, end, total jobs
- def get_prev_job_output_volume(
- self, ifm: Rect, ofm: Rect, ifm_block_depth, ofm_block: Block, kernel: Kernel, block_offset
- ):
+ def get_prev_job_output_volume(self, ofm: Rect, ofm_block: Block, block_offset):
assert block_offset >= 0
# Get OFM block's volume coordinates
@@ -527,28 +524,20 @@ class ArchitectureFeatures:
start_coord[1] + ofm_block.height,
start_coord[2] + ofm_block.depth,
)
-
- # Calculate how many IFM blocks this OFM block requires (i.e how many jobs)
- ifm_depth_blocks = round_up_divide(ifm.size().depth, ifm_block_depth)
- ifm_depth_blocks = 1 # Overwrite with 1 to force OFM block dependency, not IFM
-
- return (start_coord, end_coord, ifm_depth_blocks) # start, end, total jobs for this OFM block
+ return (start_coord, end_coord, 1) # start, end, total jobs for this OFM block
def calc_block_dep(
self,
- prev_ifm: Rect,
prev_ofm: Rect,
- prev_ifm_block_depth,
prev_ofm_block: Block,
- prev_kernel: Kernel,
ifm: Rect,
ofm: Rect,
ifm_block_depth,
ofm_block: Block,
kernel: Kernel,
padLT,
+ intersects,
):
-
blockdep = ArchitectureFeatures.MAX_BLOCKDEP
# Iterate over the next BLOCKDEP inputs, checking to see if a sliding window
@@ -566,16 +555,14 @@ class ArchitectureFeatures:
outstanding_jobs = 0
for block_offset in range(ArchitectureFeatures.MAX_BLOCKDEP):
# This is the OFM block being generated by the previous op
- out_area = self.get_prev_job_output_volume(
- prev_ifm, prev_ofm, prev_ifm_block_depth, prev_ofm_block, prev_kernel, block_offset
- )
+ out_area = self.get_prev_job_output_volume(prev_ofm, prev_ofm_block, block_offset)
if out_area is None:
break
# Block dependency is the max number of allowed outstanding jobs
# in the pipeline. Selected by determining how many jobs occur
# in between two operators' overlapping OFM->IFM block volumes
- if ArchitectureFeatures.intersects(in_area[0], in_area[1], out_area[0], out_area[1]):
+ if intersects(in_area[0], in_area[1], out_area[0], out_area[1]):
break
# Early exit if no intersections and we've seen enough jobs in the pipeline
elif outstanding_jobs > ArchitectureFeatures.MAX_BLOCKDEP: