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

[FLINK-17795][example] Add MatrixVectorMul example #12398

Closed
wants to merge 2 commits into from

Conversation

KarmaGYZ
Copy link
Contributor

What is the purpose of the change

Add MatrixVectorMul example. In this example, we implement the matrix-vector multiplication program that shows how to leverage GPU resources in Flink.

Notice that this example could only be executed in a Linux environment with CUDA 10.0.

Brief change log

Add MatrixVectorMul example.

Verifying this change

I manually test it in a Linux environment with NVIDIA GPU and CUDA 10.0 toolkit.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): yes
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 78762a3 (Fri May 29 02:04:44 UTC 2020)

Warnings:

  • 1 pom.xml files were touched: Check for build and licensing issues.
  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented May 29, 2020

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating this PR @KarmaGYZ. The example looks good to me. I had a question concerning the limitations of JCuda and the juggling of temp directories. Moreover, I would suggest to not include this example in flink-dist. I believe that it is too specific for an example.

flink-dist/src/main/assemblies/bin.xml Outdated Show resolved Hide resolved
Comment on lines +114 to +119
<exclusion>
<groupId>org.jcuda</groupId>
<artifactId>jcublas-natives</artifactId>
</exclusion>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Why can we exclude it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@zentol
Copy link
Contributor

zentol commented Jun 8, 2020

I would like to hold off on merging this PR.

There are some ongoing discussions related to CUDA in LEGAL-515/LEGAL-516, which make it difficult to nail down what the licensing situation actually looks like.
While the JCuda project itself is MIT licensed, they do compile against the NVIDIA CUDA headers, which may impose limitations that are not compliant with the ASF.

While we aren't redistributing JCuda in the usual sense, we still offer a one-click retrieval service for users without providing additional legal information, which is effectively the same.

@tillrohrmann
Copy link
Contributor

@zentol do you think it would be good enough to remove add-jcuda-dependency.sh and add a section to the example description which explains how to download the cuda library manually?

@zentol
Copy link
Contributor

zentol commented Jun 9, 2020

@tillrohrmann That would probably be fine. The example itself isn't a problem since all native code is(?) contained in the *-natives dependencies that we exclude.

@tillrohrmann
Copy link
Contributor

Ok, then let's do it like this. We remove the add-jcuda-dependency.sh script and write it in the JavaDocs of the example what the requirements are and where you can download the native code. Would this be ok with you @KarmaGYZ?

@KarmaGYZ
Copy link
Contributor Author

KarmaGYZ commented Jun 9, 2020

@tillrohrmann I'm ok with it.
Regarding the legal issue, I afraid that I don't fully understand the problem. Is it only related to the native codes? Could @zentol help to check the https://repo1.maven.org/maven2/org/jcuda/jcuda/10.0.0/jcuda-10.0.0.jar?

@KarmaGYZ
Copy link
Contributor Author

KarmaGYZ commented Jun 9, 2020

@tillrohrmann Thanks for the review. PR updated according to the latest consensus.

@zentol
Copy link
Contributor

zentol commented Jun 9, 2020

@KarmaGYZ Yes, this is only about the native code, since that is what is being compiled against the cuda headers. The linked jar only contains java code, and thus should be fine.

@KarmaGYZ
Copy link
Contributor Author

@zentol Thanks for the explanation and help!

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing our comments @KarmaGYZ. LGTM. Merging this PR now.

tillrohrmann pushed a commit that referenced this pull request Jun 10, 2020
nicusX pushed a commit to nicusX/flink that referenced this pull request Jun 13, 2020
zhangjun0x01 pushed a commit to zhangjun0x01/flink that referenced this pull request Jul 8, 2020
@KarmaGYZ KarmaGYZ deleted the gpu-case branch February 26, 2021 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants