Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ox696c
ktransformers
Commits
574b1339
Commit
574b1339
authored
Feb 20, 2025
by
liam
Browse files
⚡
fin docker-image
parent
b4fb6339
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
106 additions
and
1 deletion
+106
-1
.github/workflows/docker-image.yml
.github/workflows/docker-image.yml
+104
-0
Dockerfile
Dockerfile
+2
-1
No files found.
.github/workflows/docker-image.yml
0 → 100644
View file @
574b1339
name
:
DockerHub CI
on
:
release
:
types
:
[
published
]
# push:
# branches:
# - main
env
:
DOCKERHUB_REPO
:
${{ secrets.DOCKERHUB_USERNAME }}/ktransformers
jobs
:
test
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Run tests
run
:
|
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
docker_task
:
needs
:
test
name
:
${{ matrix.instruct}}
runs-on
:
ubuntu-latest
strategy
:
fail-fast
:
false
matrix
:
include
:
# for amd64
-
{
instruct
:
"
FANCY"
,
platform
:
"
linux/amd64"
}
-
{
instruct
:
"
AVX512"
,
platform
:
"
linux/amd64"
}
-
{
instruct
:
"
AVX2"
,
platform
:
"
linux/amd64"
}
-
{
instruct
:
"
NATIVE"
,
platform
:
"
linux/amd64"
}
# for arm64
-
{
instruct
:
"
NATIVE"
,
platform
:
"
linux/arm64"
}
# 运行测试,如果需要的话,将注释取消掉并且修改为自己需要的内容
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
steps
:
# - uses: actions/checkout@v2
# - name: Run tests
# run: |
# if [ -f docker-compose.test.yml ]; then
# docker-compose --file docker-compose.test.yml build
# docker-compose --file docker-compose.test.yml run sut
# else
# docker build . --file Dockerfile
# fi
# needs: test
-
name
:
Move Docker data directory
run
:
|
sudo systemctl stop docker
sudo mkdir -p /mnt/docker
sudo rsync -avz /var/lib/docker/ /mnt/docker
sudo rm -rf /var/lib/docker
sudo ln -s /mnt/docker /var/lib/docker
sudo systemctl start docker
-
name
:
Set up QEMU
uses
:
docker/setup-qemu-action@v3
-
name
:
Set up Docker Buildx
uses
:
docker/setup-buildx-action@v3
-
name
:
Login to Docker Hub
uses
:
docker/login-action@v3
with
:
username
:
${{ secrets.DOCKERHUB_USERNAME }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
-
name
:
Build and push for amd64
if
:
matrix.platform == 'linux/amd64'
uses
:
docker/build-push-action@v6
with
:
push
:
true
platforms
:
|
linux/amd64
tags
:
|
${{ env.DOCKERHUB_REPO }}:latest-${{ matrix.instruct }}
${{ env.DOCKERHUB_REPO }}:${{ github.event.release.tag_name }}-${{ matrix.instruct }}
build-args
:
|
CPU_INSTRUCT=${{ matrix.instruct }}
-
name
:
Build and push for arm64
if
:
matrix.platform == 'linux/arm64'
uses
:
docker/build-push-action@v6
with
:
push
:
true
platforms
:
|
linux/arm64
tags
:
|
${{ env.DOCKERHUB_REPO }}:latest-${{ matrix.instruct }}
${{ env.DOCKERHUB_REPO }}:${{ github.event.release.tag_name }}-${{ matrix.instruct }}
build-args
:
|
CPU_INSTRUCT=${{ matrix.instruct }}
\ No newline at end of file
Dockerfile
View file @
574b1339
...
...
@@ -11,6 +11,7 @@ EOF
FROM
pytorch/pytorch:2.3.1-cuda12.1-cudnn8-devel as compile_server
ARG
CPU_INSTRUCT=NATIVE
WORKDIR
/workspace
ENV
CUDA_HOME /usr/local/cuda
COPY
--from=web_compile /home/ktransformers /workspace/ktransformers
...
...
@@ -28,7 +29,7 @@ git submodule init &&
git submodule update &&
pip install ninja pyproject numpy cpufeature &&
pip install flash-attn &&
CPU_INSTRUCT=
NATIVE
KTRANSFORMERS_FORCE_BUILD=TRUE TORCH_CUDA_ARCH_LIST="8.0;8.6;8.7;8.9;9.0+PTX" pip install . --no-build-isolation --verbose &&
CPU_INSTRUCT=
${CPU_INSTRUCT}
KTRANSFORMERS_FORCE_BUILD=TRUE TORCH_CUDA_ARCH_LIST="8.0;8.6;8.7;8.9;9.0+PTX" pip install . --no-build-isolation --verbose &&
pip cache purge
EOF
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment