Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depthwise convolution for oneAPI #1131

Merged
merged 129 commits into from
Dec 18, 2024

Conversation

laurilaatu
Copy link
Contributor

@laurilaatu laurilaatu commented Nov 18, 2024

Description

📝 This pull request adds Depthwise convolution to oneAPI backend.

Type of change

Adding Depthwise convolution in a parallel implementation. Supports depth multiplier. When a separable convolution layer is used, it is split to depthwise and pointwise layers.

Note: Please delete options that are not relevant.

  • Bug fix (non-breaking change that fixes an issue)
  • Documentation update
  • New feature (non-breaking change which adds functionality)
  • A new research paper code implementation
  • Other (Specify)

Tests

📝 Pytests included and models compiled with depthwise and separable convolution.

Test Configuration:

model = Sequential()
model.add(DepthwiseConv2D(input_shape = (10,10,3), kernel_size=(3,3), padding="same", depth_multiplier=2, activation='relu', strides=(2,2)))
model.compile(loss='mse', optimizer=Adam())
model.summary()

config = hls4ml.utils.config_from_keras_model(model, granularity='name', default_precision='ac_fixed<16, 6>')
hls_model = hls4ml.converters.convert_from_keras_model(model=model, output_dir="model_dconv_out", backend="oneAPI", part="Agilex7", hls_config=config)
hls_model.compile()

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have installed and run pre-commit on the files I edited or added.
  • I have added tests that prove my fix is effective or that my feature works.

@jmitrevs
Copy link
Contributor

Is it worth adding 1D versions, too?

@jmitrevs
Copy link
Contributor

Why so many commits? Is it worth rebasing on a new branch from main?

@jmitrevs jmitrevs added the please test Trigger testing by creating local PR branch label Nov 18, 2024
@jmitrevs jmitrevs added please test Trigger testing by creating local PR branch and removed please test Trigger testing by creating local PR branch labels Dec 16, 2024
@JanFSchulte
Copy link
Contributor

Will this really add 129 new commits, or is this just some confusion? Might be good to squash the commits to prevent that.

@jmitrevs
Copy link
Contributor

It should be squashed.

@jmitrevs
Copy link
Contributor

The squashing would be when we merge the PR, by selecting squash and merge, right? There's no need to manually squash the commits.

@JanFSchulte
Copy link
Contributor

Ah, yes. I was looking for a squash button yesterday, didn't realize it was in the drop down next to the green button. I'll merge now.

@JanFSchulte JanFSchulte merged commit 47939cb into fastmachinelearning:main Dec 18, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please test Trigger testing by creating local PR branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants