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

python3Packages.pytorch-ocl: init at 0.2.0 #349547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zeuner
Copy link
Contributor

@zeuner zeuner commented Oct 18, 2024

Adding an out-of-tree backend to use pytorch accelerated by OpenCL devices.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@@ -12987,6 +12987,8 @@ self: super: with self; {

pytools = callPackage ../development/python-modules/pytools { };

pytorch-ocl = callPackage ../development/python-modules/pytorch-ocl { };
Copy link
Contributor

Choose a reason for hiding this comment

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

formatting seems to be off

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

"pytorch_ocl"
];

meta = with lib; {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
meta = with lib; {
meta = {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considering that, but could you give me more information about why going without the with statement is better? I'm asking because I had PRs where the exact opposite (moving lib outside into a with statement) was requested in reviews.

Copy link
Contributor

Choose a reason for hiding this comment

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

https://nix.dev/guides/best-practices.html

I just read it here where they say to avoid using 'with', smaller scopes are supposedly fine, so I guess you can ignore it if you don't feel like changing this part

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given the large number of packages using meta = with lib; {... currently, I guess it's indeed fine, and will stick with it for now. Anyway thanks for the pointer.


meta = with lib; {
description = "DLPrimitives/OpenCL out of tree backend for pytorch";
maintainers = with maintainers; [ gm6k ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
maintainers = with maintainers; [ gm6k ];
maintainers = with lib.maintainers; [ gm6k ];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

meta = with lib; {
description = "DLPrimitives/OpenCL out of tree backend for pytorch";
maintainers = with maintainers; [ gm6k ];
license = licenses.mit;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
license = licenses.mit;
license = lib.licenses.mit;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

homepage = "https://github.com/artyom-beilis/pytorch_dlprim";
changelog = "https://github.com/artyom-beilis/pytorch_dlprim/releases/tag/${src.rev}";
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

src = fetchFromGitHub {
owner = "artyom-beilis";
repo = "pytorch_dlprim";
rev = "${version}";
Copy link
Contributor

@Daholli Daholli Oct 18, 2024

Choose a reason for hiding this comment

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

Suggested change
rev = "${version}";
rev = "${finalAttrs.version}";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

@FliegendeWurst
Copy link
Member

@ofborg build python312Packages.pytorch-ocl

@FliegendeWurst FliegendeWurst added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 10, 2024
Copy link
Member

@FliegendeWurst FliegendeWurst left a comment

Choose a reason for hiding this comment

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

Just checked again, with current versions of dependencies the build fails: https://paste.fliegendewurst.eu/2AHXPc.log#L126

CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR and more are not defined.

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 9, 2025
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.

4 participants