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

Make openai-triton/pytorch free again (and various fixes) #263048

Merged
merged 19 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6e69f00
python3Packages.openai-triton: don't download ptxas for non-cuda build
Madouura Oct 23, 2023
ac0b05f
python3Packages.torch: include openai-triton in propagatedBuildInputs…
Madouura Oct 23, 2023
b5dce72
openai-triton-llvm: init at 14.0.6-f28c006a5895
Madouura Oct 23, 2023
b280dea
rapidjson-unstable: rewrite and fix tests
Madouura Oct 24, 2023
a92172b
python3Packages.pytorch-pfn-extras: fixup tests
Madouura Oct 24, 2023
071f6a5
python3Packages.pytorch-pfn-extras: fixup tests for python 3.11
Madouura Oct 24, 2023
b45ba74
python3Packages.arviz: fixup tests
Madouura Oct 24, 2023
f7f968c
python3Packages.cvxpy: 1.3.2 -> 1.4.1
Madouura Oct 24, 2023
fec04ec
python3Packages.torchinfo: disable failing test
Madouura Oct 24, 2023
1f25043
python3Packages.ax: disable failing tests
Madouura Oct 24, 2023
0775491
python3Packages.stytra: fix tests
Madouura Oct 24, 2023
956abdc
python3Packages.mayavi: disable for python 3.11
Madouura Oct 24, 2023
6d7ae4f
python3Packages.torch: propagate pybind11
Madouura Oct 24, 2023
29501a6
python3Packages.skrl: fix for python-3.10 and use pyproject
Madouura Oct 25, 2023
8398d16
python3Packages.spacy_models: add ja and sl language models
Madouura Oct 26, 2023
6c8a5de
python3Packages.cleanlab: fixup build, tests, use pyproject
Madouura Oct 27, 2023
96619a0
python3Packages.omegaconf: improve python 3.11 support
Madouura Oct 27, 2023
77ab93a
python3Packages.fairseq: fix python 3.11 build
Madouura Oct 27, 2023
3aab2bc
python3Packages.torchmetrics: work around tests duplicate package issue
Madouura Nov 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}:

stdenv.mkDerivation (finalAttrs: {
pname = "triton-llvm";
pname = "openai-triton-llvm";
version = "14.0.6-f28c006a5895";

outputs = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 11c1b04c..762eaa75 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,20 +1,14 @@
-find_package(GTestSrc)
+enable_testing()

-IF(GTESTSRC_FOUND)
- enable_testing()
+if (WIN32 AND (NOT CYGWIN) AND (NOT MINGW))
+ set(gtest_disable_pthreads ON)
+ set(gtest_force_shared_crt ON)
+endif()

- if (WIN32 AND (NOT CYGWIN) AND (NOT MINGW))
- set(gtest_disable_pthreads ON)
- set(gtest_force_shared_crt ON)
- endif()
+include_directories(SYSTEM ${GTEST_INCLUDE_DIR})

- add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest)
- include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
+set(TEST_LIBRARIES gtest gtest_main)

- set(TEST_LIBRARIES gtest gtest_main)
-
- add_custom_target(tests ALL)
- add_subdirectory(perftest)
- add_subdirectory(unittest)
-
-ENDIF(GTESTSRC_FOUND)
+add_custom_target(tests ALL)
+add_subdirectory(perftest)
+add_subdirectory(unittest)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/test/valgrind.supp b/test/valgrind.supp
index c9d3d226..63af7bf9 100644
--- a/test/valgrind.supp
+++ b/test/valgrind.supp
@@ -24,3 +24,31 @@
fun:*Uri*Parse_UTF16_Std*
}

+{
+ Suppress memcpy_chk valgrind report 5
+ Memcheck:Overlap
+ fun:__memcpy_chk
+ fun:*dtoa_normal*
+}
+
+{
+ Suppress memcpy_chk valgrind report 6
+ Memcheck:Overlap
+ fun:__memcpy_chk
+ fun:*dtoa_maxDecimalPlaces*
+}
+
+{
+ Suppress memcpy_chk valgrind report 7
+ Memcheck:Overlap
+ fun:__memcpy_chk
+ ...
+ fun:*Reader*ParseDoubleHandler*
+}
+
+{
+ Suppress memcpy_chk valgrind report 8
+ Memcheck:Overlap
+ fun:__memcpy_chk
+ fun:*Reader*ParseNumber_NormalPrecisionError*
+}
66 changes: 49 additions & 17 deletions pkgs/development/libraries/rapidjson/unstable.nix
Original file line number Diff line number Diff line change
@@ -1,50 +1,82 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, pkg-config
, cmake
, doxygen
, graphviz
, gtest
, valgrind
# One of "11" or "17"; default in source is CXX 11
, cxxStandard ? "11"
, buildDocs ? true
, buildTests ? !stdenv.hostPlatform.isStatic && !stdenv.isDarwin
, buildExamples ? true
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "rapidjson";
version = "unstable-2023-09-28";

outputs = [
"out"
] ++ lib.optionals buildDocs [
"doc"
] ++ lib.optionals buildExamples [
"example"
];

src = fetchFromGitHub {
owner = "Tencent";
repo = "rapidjson";
rev = "f9d53419e912910fd8fa57d5705fa41425428c35";
hash = "sha256-rl7iy14jn1K2I5U2DrcZnoTQVEGEDKlxmdaOCF/3hfY=";
};

patches = lib.optionals buildTests [
./0000-unstable-use-nixpkgs-gtest.patch
# https://github.com/Tencent/rapidjson/issues/2214
./0001-unstable-valgrind-suppress-failures.patch
];

nativeBuildInputs = [
pkg-config
cmake
] ++ lib.optionals buildDocs [
doxygen
graphviz
];

patches = [
(fetchpatch {
name = "do-not-include-gtest-src-dir.patch";
url = "https://git.alpinelinux.org/aports/plain/community/rapidjson/do-not-include-gtest-src-dir.patch?id=9e5eefc7a5fcf5938a8dc8a3be8c75e9e6809909";
hash = "sha256-BjSZEwfCXA/9V+kxQ/2JPWbc26jQn35CfN8+8NW24s4=";
})
cmakeFlags = [
(lib.cmakeBool "RAPIDJSON_BUILD_DOC" buildDocs)
(lib.cmakeBool "RAPIDJSON_BUILD_TESTS" buildTests)
(lib.cmakeBool "RAPIDJSON_BUILD_EXAMPLES" buildExamples)
(lib.cmakeBool "RAPIDJSON_BUILD_CXX11" (cxxStandard == "11"))
(lib.cmakeBool "RAPIDJSON_BUILD_CXX17" (cxxStandard == "17"))
] ++ lib.optionals buildTests [
(lib.cmakeFeature "GTEST_INCLUDE_DIR" "${lib.getDev gtest}")
];

doCheck = buildTests;

nativeCheckInputs = [
gtest
valgrind
];

# for tests, adding gtest to checkInputs does not work
# https://github.com/NixOS/nixpkgs/pull/212200
buildInputs = [ gtest ];
cmakeFlags = [ "-DGTEST_SOURCE_DIR=${gtest.dev}/include" ];
postInstall = lib.optionalString buildExamples ''
mkdir -p $example/bin

nativeCheckInputs = [ valgrind ];
doCheck = !stdenv.hostPlatform.isStatic && !stdenv.isDarwin;
find bin -type f -executable \
-not -name "perftest" \
-not -name "unittest" \
-exec cp -a {} $example/bin \;
'';

meta = with lib; {
description = "Fast JSON parser/generator for C++ with both SAX/DOM style API";
homepage = "http://rapidjson.org/";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ Madouura ];
broken = (cxxStandard != "11" && cxxStandard != "17");
doronbehar marked this conversation as resolved.
Show resolved Hide resolved
};
}
})
4 changes: 4 additions & 0 deletions pkgs/development/python-modules/arviz/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, pyro-ppl
#, pystan (not packaged)
, numpyro
, bokeh
}:

buildPythonPackage rec {
Expand Down Expand Up @@ -72,6 +73,7 @@ buildPythonPackage rec {
pytestCheckHook
torchvision
zarr
bokeh
];

preCheck = ''
Expand All @@ -97,6 +99,8 @@ buildPythonPackage rec {
# An issue has been opened upstream: https://github.com/arviz-devs/arviz/issues/2282
"test_plot_ppc_discrete"
"test_plot_ppc_discrete_save_animation"
# Assertion error
"test_data_zarr"
];

pythonImportsCheck = [
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/python-modules/ax/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ buildPythonPackage rec {
disabledTests = [
# exact comparison of floating points
"test_optimize_l0_homotopy"
# AssertionError: 5 != 2
"test_get_standard_plots_moo"
# AssertionError: Expected 'warning' to be called once. Called 3 times
"test_validate_kwarg_typing"
];
pythonImportsCheck = [ "ax" ];

Expand Down
49 changes: 37 additions & 12 deletions pkgs/development/python-modules/cleanlab/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,27 @@
, termcolor
, tqdm
, pandas
, setuptools
# test dependencies
, pytestCheckHook
, pytest-lazy-fixture
, tensorflow
, torch
, datasets
, torchvision
, keras
, fasttext
, hypothesis
, wget
, matplotlib
, skorch
}:
let

buildPythonPackage rec {
pname = "cleanlab";
version = "2.5.0";
in
buildPythonPackage {
inherit pname version;
format = "setuptools";

disabled = pythonOlder "3.8";
pyproject = true;
disabled = pythonOlder "3.7";
Copy link
Contributor

Choose a reason for hiding this comment

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

Just out of curiosity, why is this needed? When we don't recurseIntoAttrs python37.pkgs since a long time now.


src = fetchFromGitHub {
owner = "cleanlab";
Expand All @@ -31,11 +35,7 @@ buildPythonPackage {
hash = "sha256-5XQQVrhjpvjwtFM79DqttObmw/GQLkMQVXb5jhiC8e0=";
};

# postPatch = ''
# substituteInPlace pyproject.toml \
# --replace '"rich <= 13.0.1"' '"rich"' \
# --replace '"numpy < 1.24.0"' '"numpy"'
# '';
nativeBuildInputs = [ setuptools ];

propagatedBuildInputs = [
scikit-learn
Expand All @@ -44,13 +44,38 @@ buildPythonPackage {
pandas
];

# This is ONLY turned off when we have testing enabled.
# The reason we do this is because of duplicate packages in the enclosure
# when using the packages in nativeCheckInputs.
# Affected packages: grpcio protobuf tensorboard tensorboard-plugin-profile
Comment on lines +47 to +50
Copy link
Contributor

Choose a reason for hiding this comment

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

But why aren't they identical?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, but it complained about duplicate packages in the enclosure without catchConflicts so I put the message there.

Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a symptom that we call the expression taking arguments from the wrong/inconsistent package sets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, tensorflow is an input for that package.
Now it makes sense, it's because of it's custom protobuf, grpc, etc that it's likely propagating.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can make tensorflow use https://discourse.nixos.org/t/allowing-multiple-versions-of-python-package-in-pythonpath-nixpkgs/3849 python-rewrite-imports for its old protobuf - later

catchConflicts = (!doCheck);
doCheck = true;
mweinelt marked this conversation as resolved.
Show resolved Hide resolved

nativeCheckInputs = [
pytestCheckHook
pytest-lazy-fixture
tensorflow
torch
datasets
torchvision
keras
fasttext
hypothesis
wget
matplotlib
skorch
];

disabledTests = [
# Requires the datasets we prevent from downloading
"test_create_imagelab"
];

disabledTestPaths = [
# Requires internet
"tests/test_dataset.py"
# Requires the datasets we just prevented from downloading
"tests/datalab/test_cleanvision_integration.py"
];

meta = with lib; {
Expand Down
7 changes: 4 additions & 3 deletions pkgs/development/python-modules/cvxpy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
, scs
, setuptools
, wheel
, pybind11
, useOpenmp ? (!stdenv.isDarwin)
}:

buildPythonPackage rec {
pname = "cvxpy";
version = "1.3.2";
version = "1.4.1";
format = "pyproject";

disabled = pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
hash = "sha256-C2heUEDxmfPXA/MPXSLR+GVZdiNFUVPR3ddwJFrvCXU=";
hash = "sha256-ep7zTjxX/4yETYbwo4NPtVda8ZIzlHY53guld8YSLj4=";
};

# we need to patch out numpy version caps from upstream
Expand All @@ -35,6 +36,7 @@ buildPythonPackage rec {
nativeBuildInputs = [
setuptools
wheel
pybind11
];

propagatedBuildInputs = [
Expand All @@ -44,7 +46,6 @@ buildPythonPackage rec {
osqp
scipy
scs
setuptools
];

nativeCheckInputs = [
Expand Down
Loading