Skip to content

Commit

Permalink
Publish Accelerated Peft and Fused-Ops Plugins (#51)
Browse files Browse the repository at this point in the history
* enabled tox build sections and cli tool installation from pypi

* formatting
  • Loading branch information
achew010 authored Jul 15, 2024
1 parent 06dcc4d commit 33a32f5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 31 deletions.
26 changes: 13 additions & 13 deletions plugins/accelerated-peft/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ commands =
isort {posargs:.}


# [testenv:build]
# description = build wheel
# deps =
# build
# commands = python -m build -w
# skip_install = True
#
# [testenv:twinecheck]
# description = check wheel
# deps =
# twine
# commands = twine check dist/*
# skip_install = True
[testenv:build]
description = build wheel
deps =
build
commands = python -m build -w
skip_install = True

[testenv:twinecheck]
description = check wheel
deps =
twine
commands = twine check dist/*
skip_install = True
22 changes: 17 additions & 5 deletions plugins/framework/src/fms_acceleration/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,30 @@ def install_plugin(
pipmain(["install", *args, pkg_name])
return

if pkg_name.startswith(PLUGIN_PREFIX):
pkg_name = pkg_name.replace(PLUGIN_PREFIX, "")

# otherwise should be an internet install
pipmain(
response = pipmain(
[
"install",
*args,
f"git+https://{GITHUB_URL}#subdirectory=plugins/accelerated-{pkg_name}",
pkg_name,
]
)

# Reference from https://github.com/pypa/pip/blob/main/src/pip/_internal/cli/status_codes.py
if response > 0:
print("PyPi installation failed. Falling back to installation from Github.")

if pkg_name.startswith(PLUGIN_PREFIX):
pkg_name = pkg_name.replace(PLUGIN_PREFIX, "")

pipmain(
[
"install",
*args,
f"git+https://{GITHUB_URL}#subdirectory=plugins/accelerated-{pkg_name}",
]
)


def list_plugins():
print(
Expand Down
26 changes: 13 additions & 13 deletions plugins/fused-ops-and-kernels/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ commands =
black --exclude .*unsloth.* tests
isort .

# [testenv:build]
# description = build wheel
# deps =
# build
# commands = python -m build -w
# skip_install = True
#
# [testenv:twinecheck]
# description = check wheel
# deps =
# twine
# commands = twine check dist/*
# skip_install = True
[testenv:build]
description = build wheel
deps =
build
commands = python -m build -w
skip_install = True

[testenv:twinecheck]
description = check wheel
deps =
twine
commands = twine check dist/*
skip_install = True

0 comments on commit 33a32f5

Please sign in to comment.