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

DOC Add basic example gallery infrastructure and two examples #5845

Draft
wants to merge 3 commits into
base: branch-24.06
Choose a base branch
from

Conversation

betatim
Copy link
Member

@betatim betatim commented Apr 12, 2024

I have been looking at the scikit-learn gallery and attempting to "translate" examples from it to use RAPIDS projects where possible. Mostly this is an exercise in learning how such transformations look, what changes are common, etc

I thought it could be nice to add these examples to the cuml gallery, realised there was none and hence this PR.

It adds basic infrastructure to make a gallery work. The gallery is a new section in the documentation and examples are cross linked from the API docs of a class (at the bottom of KMeans it shows a thumbnail for the example that uses KMeans).

What do people think of this?

It would be ideal to somehow be able to highlight the differences between the "cuml" and "scikit-learn" versions of an example. That way readers could more easily see the bits that are relevant to "I have CPU code and want to move to GPU". However, I don't know how to do that :D

I plan to translate a few more examples, but not all of them. I think getting this merged even with a "slim" gallery to start would be good, that way others could also add examples (instead of having one mega PR that is essentially blocked on one person and unreviewable)

Marking as draft for now to see what the CI robots say and what needs fixing up for the docs preview.

Copy link

copy-pr-bot bot commented Apr 12, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions bot added the conda conda issue label Apr 12, 2024
Copy link
Member

@dantegd dantegd left a comment

Choose a reason for hiding this comment

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

Love the addition @betatim !

Example gallery
===============

Below is a gallery of examples showing how to use cuml.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Below is a gallery of examples showing how to use cuml.
Below is a gallery of examples showing how to use cuML.

@@ -0,0 +1,128 @@
"""
Copy link
Member

Choose a reason for hiding this comment

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

Copyright header

Copy link
Member Author

@betatim betatim Apr 17, 2024

Choose a reason for hiding this comment

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

Good point. I was wondering how to deal with licensing and attribution. My best guess so far would be something like the following. Though the BSD3 license says we also need to reproduce the 3 clauses and disclaimer. But that would add excessive amount of text to the top of each file. Maybe we can deal with it in some other way? Is there prior art somewhere?

# BSD 3-Clause License
# 
# Copyright (c) 2007-2024 The scikit-learn developers.
# All rights reserved.
#
#
# Copyright (c) 2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

@@ -0,0 +1,247 @@
# -*- coding: utf-8 -*-
Copy link
Member

Choose a reason for hiding this comment

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

Same as before

@@ -0,0 +1,205 @@
"""
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conda conda issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants