ROCm / ROCm/AMDMIGraphX

Padding as fusion

Open
#3,239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
333
Forks
150
Avg merge
4d 19h
Merged PRs (30d)
54

Description

Many CNNs layers use padding (of 1) on their inputs, usually by adding 0s to the halo around the image size. Another way to pad (better in certain situations, but not necessarily always) is by repetition of the nearest data on the boundary.

A good way to implement any pad style is by explicitly padding the data on the output of the layer that produces them (typically a previous convolution). Explicitly here means to have memory that corresponds to (H+2)x(W+2) image, as opposed to HxW image.

A no brainer situation that this scheme will be better than the explicit calculation, is when H,W are not already magic numbers, i.e. when incrementing them will not increase the number of workgroups, or reduce the cache line utilization. For example, the image size of 224 for imagenet would not suffer by increasing it to 226!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is identified. First clarify which padding operations and graph transformations are in scope, then locate the relevant convolution and padding implementation in MIGraphX. Done should include an agreed implementation approach, coverage for zero and boundary-repetition padding, and evidence that the intended image-size cases benefit.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.