Unverified Commit 90e1179c authored by Someone's avatar Someone Committed by GitHub
Browse files

Merge pull request #328258 from cfhammill/vllm-version-bump

python3Packages.vllm: 0.3.3->0.5.2
parents 2d53b6bb 17a50f14
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pydantic,
  interegular,
  pyyaml,
  poetry-core,
}:

buildPythonPackage rec {
  pname = "lm-format-enforcer";
  version = "0.10.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "noamgat";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-GOnMj910rgzYeIeN2yLcXZDDel/Hu6nv7ov5BrlHJLg=";
  };

  build-system = [ poetry-core ];

  dependencies = [
    interegular
    pydantic
    pyyaml
  ];

  doCheck = false; # most tests require internet access

  pythonImportsCheck = [ "lmformatenforcer" ];

  meta = with lib; {
    description = "Enforce the output format (JSON Schema, Regex etc) of a language model";
    changelog = "https://github.com/noamgat/lm-format-enforcer/releases/tag/v${version}";
    homepage = "https://github.com/noamgat/lm-format-enforcer";
    license = licenses.mit;
    maintainers = with maintainers; [ cfhammill ];
  };
}
+10 −3
Original line number Diff line number Diff line
@@ -6,9 +6,12 @@
  setuptools-scm,
  interegular,
  cloudpickle,
  datasets,
  diskcache,
  joblib,
  jsonschema,
  pyairports,
  pycountry,
  pydantic,
  lark,
  nest-asyncio,
@@ -38,6 +41,7 @@ buildPythonPackage rec {
  propagatedBuildInputs = [
    interegular
    cloudpickle
    datasets
    diskcache
    joblib
    jsonschema
@@ -48,16 +52,19 @@ buildPythonPackage rec {
    scipy
    torch
    transformers
    pycountry
    pyairports
  ];

  pythonImportsCheck = [ "outlines" ];
  checkPhase = ''
    export HOME=$(mktemp -d)
    python3 -c 'import outlines'
  '';

  meta = with lib; {
    description = "Structured text generation";
    homepage = "https://github.com/outlines-dev/outlines";
    license = licenses.asl20;
    maintainers = with maintainers; [ lach ];
    # Missing dependencies since the last update
    broken = true;
  };
}
+30 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchPypi,
  setuptools,
}:

buildPythonPackage rec {
  pname = "pyairports";
  version = "2.1.1";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-PWCnJ/zk2oG5xjk+qK4LM9Z7N+zjRN/8hj90njrWK80=";
  };

  build-system = [ setuptools ];

  doCheck = false;

  pythonImportChecks = [ "pyairports" ];

  meta = with lib; {
    description = "pyairports is a package which enables airport lookup by 3-letter IATA code.";
    homepage = "https://github.com/ozeliger/pyairports";
    license = licenses.asl20;
    maintainers = with maintainers; [ cfhammill ];
  };
}
+24 −0
Original line number Diff line number Diff line
From f6a7748bee79fc2e1898968fef844daacfa7860b Mon Sep 17 00:00:00 2001
From: SomeoneSerge <else@someonex.net>
Date: Wed, 31 Jul 2024 12:02:53 +0000
Subject: [PATCH 1/2] setup.py: don't ask for hipcc --version

---
 setup.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/setup.py b/setup.py
index 72ef26f1..01e006f9 100644
--- a/setup.py
+++ b/setup.py
@@ -279,6 +279,7 @@ def _install_punica() -> bool:
 
 
 def get_hipcc_rocm_version():
+    return "0.0" # `hipcc --version` misbehaves ("unresolved paths") inside the nix sandbox
     # Run the hipcc --version command
     result = subprocess.run(['hipcc', '--version'],
                             stdout=subprocess.PIPE,
-- 
2.45.1
+40 −0
Original line number Diff line number Diff line
From 10b7e8330bdba319a4162cceb8e5dd4280215b04 Mon Sep 17 00:00:00 2001
From: SomeoneSerge <else@someonex.net>
Date: Wed, 31 Jul 2024 12:06:15 +0000
Subject: [PATCH 2/2] setup.py: nix-support (respect cmakeFlags)

---
 setup.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/setup.py b/setup.py
index 01e006f9..14762146 100644
--- a/setup.py
+++ b/setup.py
@@ -15,6 +15,15 @@ from setuptools import Extension, find_packages, setup
 from setuptools.command.build_ext import build_ext
 from torch.utils.cpp_extension import CUDA_HOME
 
+import os
+import json
+
+if "NIX_ATTRS_JSON_FILE" in os.environ:
+    with open(os.environ["NIX_ATTRS_JSON_FILE"], "r") as f:
+        NIX_ATTRS = json.load(f)
+else:
+    NIX_ATTRS = { "cmakeFlags": os.environ.get("cmakeFlags", "").split() }
+
 
 def load_module_from_path(module_name, path):
     spec = importlib.util.spec_from_file_location(module_name, path)
@@ -159,6 +168,7 @@ class cmake_build_ext(build_ext):
             '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}'.format(outdir),
             '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY={}'.format(self.build_temp),
             '-DVLLM_TARGET_DEVICE={}'.format(VLLM_TARGET_DEVICE),
+            *NIX_ATTRS["cmakeFlags"],
         ]
 
         verbose = envs.VERBOSE
-- 
2.45.1
Loading