fix: editing files in place does not work well inside the (aarch64) container environment
This PR is particularly of issue #278.
This PR fixed:
-
make prepare-sourcesalways failed in ourdevcontainer. -
make cleanremovewhisper.cpp
This PR does not fixed:
-
make gpt4all/gpt4all-bindings/golang/libgpt4all.awas failed indevcontainer
Here is the result below(It also pass the testing in macOS M1 env):
vscode ➜ /workspace (fix/prepare-sources) $ make prepare-sources
git clone --recurse-submodules https://github.com/go-skynet/go-llama.cpp go-llama
Cloning into 'go-llama'...
remote: Enumerating objects: 252, done.
remote: Counting objects: 100% (159/159), done.
remote: Compressing objects: 100% (98/98), done.
remote: Total 252 (delta 86), reused 98 (delta 59), pack-reused 93
Receiving objects: 100% (252/252), 76.12 KiB | 397.00 KiB/s, done.
Resolving deltas: 100% (121/121), done.
Submodule 'llama.cpp' (https://github.com/ggerganov/llama.cpp) registered for path 'llama.cpp'
Cloning into '/workspace/go-llama/llama.cpp'...
remote: Enumerating objects: 2848, done.
remote: Counting objects: 100% (1373/1373), done.
remote: Compressing objects: 100% (194/194), done.
remote: Total 2848 (delta 1277), reused 1194 (delta 1179), pack-reused 1475
Receiving objects: 100% (2848/2848), 2.44 MiB | 4.02 MiB/s, done.
Resolving deltas: 100% (1881/1881), done.
Submodule path 'llama.cpp': checked out '42627421ece816e632e6a0d757fa75150c687f87'
cd go-llama && git checkout -b build 7f9ae4246088f0c08ed322acbae21d69cd2eb547 && git submodule update --init --recursive --depth 1
M llama.cpp
Switched to a new branch 'build'
Submodule path 'llama.cpp': checked out '601a033475645370483973817d987928ea95f36c'
git clone --recurse-submodules https://github.com/go-skynet/go-gpt2.cpp go-gpt2
Cloning into 'go-gpt2'...
remote: Enumerating objects: 93, done.
remote: Counting objects: 100% (93/93), done.
remote: Compressing objects: 100% (68/68), done.
remote: Total 93 (delta 53), reused 51 (delta 20), pack-reused 0
Receiving objects: 100% (93/93), 37.29 KiB | 1.17 MiB/s, done.
Resolving deltas: 100% (53/53), done.
Submodule 'ggml.cpp' (https://github.com/ggerganov/ggml) registered for path 'ggml.cpp'
Cloning into '/workspace/go-gpt2/ggml.cpp'...
remote: Enumerating objects: 1512, done.
remote: Counting objects: 100% (684/684), done.
remote: Compressing objects: 100% (160/160), done.
remote: Total 1512 (delta 578), reused 581 (delta 518), pack-reused 828
Receiving objects: 100% (1512/1512), 3.87 MiB | 3.90 MiB/s, done.
Resolving deltas: 100% (991/991), done.
Submodule path 'ggml.cpp': checked out '085f6af4c3806f7ab7d908b9a6bdb209176b6e3f'
cd go-gpt2 && git checkout -b build 7bff56f0224502c1c9ed6258d2a17e8084628827 && git submodule update --init --recursive --depth 1
Switched to a new branch 'build'
# This is hackish, but needed as both go-llama and go-gpt4allj have their own version of ggml..
15
21
14
21
14
21
14
21
14
21
git clone --recurse-submodules https://github.com/nomic-ai/gpt4all gpt4all
Cloning into 'gpt4all'...
remote: Enumerating objects: 3629, done.
remote: Counting objects: 100% (3629/3629), done.
remote: Compressing objects: 100% (1327/1327), done.
remote: Total 3629 (delta 2346), reused 3448 (delta 2260), pack-reused 0
Receiving objects: 100% (3629/3629), 9.22 MiB | 12.90 MiB/s, done.
Resolving deltas: 100% (2346/2346), done.
Submodule 'llama.cpp' (https://github.com/manyoso/llama.cpp.git) registered for path 'gpt4all-backend/llama.cpp'
Cloning into '/workspace/gpt4all/gpt4all-backend/llama.cpp'...
remote: Enumerating objects: 1977, done.
remote: Counting objects: 100% (777/777), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 1977 (delta 732), reused 720 (delta 720), pack-reused 1200
Receiving objects: 100% (1977/1977), 2.02 MiB | 1.66 MiB/s, done.
Resolving deltas: 100% (1281/1281), done.
Submodule path 'gpt4all-backend/llama.cpp': checked out '03ceb39c1e729bed4ad1dfa16638a72f1843bf0c'
cd gpt4all && git checkout -b build a07237e54fcdfdb351913587052ac061a2a7bdff && git submodule update --init --recursive --depth 1
Switched to a new branch 'build'
# This is hackish, but needed as both go-llama and go-gpt4allj have their own version of ggml..
0
28
22
28
22
22
28
28
5
22
21
28
28
28
mv ./gpt4all/gpt4all-backend/llama.cpp/llama_util.h ./gpt4all/gpt4all-backend/llama.cpp/gptjllama_util.h
git clone --recurse-submodules https://github.com/donomii/go-rwkv.cpp go-rwkv
Cloning into 'go-rwkv'...
remote: Enumerating objects: 129, done.
remote: Counting objects: 100% (129/129), done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 129 (delta 60), reused 101 (delta 44), pack-reused 0
Receiving objects: 100% (129/129), 3.99 MiB | 6.02 MiB/s, done.
Resolving deltas: 100% (60/60), done.
Submodule 'rwkv.cpp' (https://github.com/saharNooby/rwkv.cpp) registered for path 'rwkv.cpp'
Cloning into '/workspace/go-rwkv/rwkv.cpp'...
remote: Enumerating objects: 1627, done.
remote: Counting objects: 100% (250/250), done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 1627 (delta 176), reused 199 (delta 151), pack-reused 1377
Receiving objects: 100% (1627/1627), 5.21 MiB | 4.58 MiB/s, done.
Resolving deltas: 100% (976/976), done.
Submodule path 'rwkv.cpp': checked out '1c363e6d5f4ec7817ceffeeb17bd972b1ce9d9d0'
Submodule 'ggml' (https://github.com/ggerganov/ggml) registered for path 'rwkv.cpp/ggml'
Cloning into '/workspace/go-rwkv/rwkv.cpp/ggml'...
remote: Enumerating objects: 1512, done.
remote: Counting objects: 100% (684/684), done.
remote: Compressing objects: 100% (157/157), done.
remote: Total 1512 (delta 578), reused 585 (delta 521), pack-reused 828
Receiving objects: 100% (1512/1512), 3.88 MiB | 2.41 MiB/s, done.
Resolving deltas: 100% (991/991), done.
Submodule path 'rwkv.cpp/ggml': checked out 'ff6e03cbcd9bf6e9fa41d49f2495c042efae4dc6'
cd go-rwkv && git checkout -b build 07166da10cb2a9e8854395a4f210464dcea76e47 && git submodule update --init --recursive --depth 1
M rwkv.cpp
Switched to a new branch 'build'
Submodule path 'rwkv.cpp': checked out '5eb8f09c146ea8124633ab041d9ea0b1f1db4459'
Submodule path 'rwkv.cpp/ggml': checked out '9d7974c3cf1284b4ddb926d94552e9fe4c4ad483'
16
13
8
git clone https://github.com/ggerganov/whisper.cpp.git
Cloning into 'whisper.cpp'...
remote: Enumerating objects: 3613, done.
remote: Counting objects: 100% (1505/1505), done.
remote: Compressing objects: 100% (371/371), done.
remote: Total 3613 (delta 1297), reused 1172 (delta 1133), pack-reused 2108
Receiving objects: 100% (3613/3613), 6.24 MiB | 12.04 MiB/s, done.
Resolving deltas: 100% (2301/2301), done.
cd whisper.cpp && git checkout -b build 95b02d76b04d18e4ce37ed8353a1f0797f1717ea && git submodule update --init --recursive --depth 1
Switched to a new branch 'build'
Submodule 'bindings/ios' (https://github.com/ggerganov/whisper.spm) registered for path 'bindings/ios'
Cloning into '/workspace/whisper.cpp/bindings/ios'...
Submodule path 'bindings/ios': checked out 'de46d9e7817fe851c109d66080239d415812d32a'
4
23
22
git clone --recurse-submodules https://github.com/go-skynet/go-bert.cpp go-bert
Cloning into 'go-bert'...
remote: Enumerating objects: 78, done.
remote: Counting objects: 100% (78/78), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 78 (delta 29), reused 53 (delta 15), pack-reused 0
Receiving objects: 100% (78/78), 19.42 KiB | 946.00 KiB/s, done.
Resolving deltas: 100% (29/29), done.
Submodule 'bert.cpp' (https://github.com/skeskinen/bert.cpp) registered for path 'bert.cpp'
Cloning into '/workspace/go-bert/bert.cpp'...
remote: Enumerating objects: 219, done.
remote: Counting objects: 100% (219/219), done.
remote: Compressing objects: 100% (115/115), done.
remote: Total 219 (delta 126), reused 193 (delta 102), pack-reused 0
Receiving objects: 100% (219/219), 154.54 KiB | 2.76 MiB/s, done.
Resolving deltas: 100% (126/126), done.
Submodule path 'bert.cpp': checked out 'cd2170ded1f4d245080874836e75b09972737089'
Submodule 'ggml' (https://github.com/ggerganov/ggml.git) registered for path 'bert.cpp/ggml'
Cloning into '/workspace/go-bert/bert.cpp/ggml'...
remote: Enumerating objects: 1512, done.
remote: Counting objects: 100% (684/684), done.
remote: Compressing objects: 100% (157/157), done.
remote: Total 1512 (delta 578), reused 585 (delta 521), pack-reused 828
Receiving objects: 100% (1512/1512), 3.88 MiB | 3.92 MiB/s, done.
Resolving deltas: 100% (991/991), done.
Submodule path 'bert.cpp/ggml': checked out '94a24c9de987fa7a551310a8ba4286e7715d8950'
cd go-bert && git checkout -b build 33118e0da50318101408986b86a331daeb4a6658 && git submodule update --init --recursive --depth 1
Switched to a new branch 'build'
15
19
9
git clone --recurse-submodules https://github.com/go-skynet/bloomz.cpp bloomz
Cloning into 'bloomz'...
remote: Enumerating objects: 287, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (53/53), done.
remote: Total 287 (delta 35), reused 64 (delta 28), pack-reused 204
Receiving objects: 100% (287/287), 2.12 MiB | 2.11 MiB/s, done.
Resolving deltas: 100% (136/136), done.
2
4
8
4
8
git clone --recurse-submodules https://github.com/mudler/go-stable-diffusion go-stable-diffusion
Cloning into 'go-stable-diffusion'...
remote: Enumerating objects: 60, done.
remote: Counting objects: 100% (60/60), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 60 (delta 31), reused 51 (delta 22), pack-reused 0
Receiving objects: 100% (60/60), 5.44 MiB | 8.45 MiB/s, done.
Resolving deltas: 100% (31/31), done.
Submodule 'ncnn' (https://github.com/Tencent/ncnn) registered for path 'ncnn'
Submodule 'stable-diffusion' (https://github.com/EdVince/Stable-Diffusion-NCNN) registered for path 'stable-diffusion'
Cloning into '/workspace/go-stable-diffusion/ncnn'...
remote: Enumerating objects: 31205, done.
remote: Counting objects: 100% (2896/2896), done.
remote: Compressing objects: 100% (322/322), done.
remote: Total 31205 (delta 2717), reused 2631 (delta 2574), pack-reused 28309
Receiving objects: 100% (31205/31205), 22.15 MiB | 10.88 MiB/s, done.
Resolving deltas: 100% (26379/26379), done.
Cloning into '/workspace/go-stable-diffusion/stable-diffusion'...
remote: Enumerating objects: 1307, done.
remote: Counting objects: 100% (88/88), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 1307 (delta 37), reused 33 (delta 25), pack-reused 1219
Receiving objects: 100% (1307/1307), 150.00 MiB | 10.10 MiB/s, done.
Resolving deltas: 100% (614/614), done.
Submodule path 'ncnn': checked out '2b87dc2cf7f07416c3781e71a478fd185d4fdfcb'
Submodule 'glslang' (https://github.com/KhronosGroup/glslang) registered for path 'ncnn/glslang'
Submodule 'python/pybind11' (https://github.com/pybind/pybind11.git) registered for path 'ncnn/python/pybind11'
Cloning into '/workspace/go-stable-diffusion/ncnn/glslang'...
remote: Enumerating objects: 53584, done.
remote: Counting objects: 100% (345/345), done.
remote: Compressing objects: 100% (157/157), done.
remote: Total 53584 (delta 195), reused 305 (delta 184), pack-reused 53239
Receiving objects: 100% (53584/53584), 69.65 MiB | 14.02 MiB/s, done.
Resolving deltas: 100% (44997/44997), done.
Cloning into '/workspace/go-stable-diffusion/ncnn/python/pybind11'...
remote: Enumerating objects: 26430, done.
remote: Counting objects: 100% (350/350), done.
remote: Compressing objects: 100% (171/171), done.
remote: Total 26430 (delta 205), reused 265 (delta 156), pack-reused 26080
Receiving objects: 100% (26430/26430), 10.30 MiB | 6.56 MiB/s, done.
Resolving deltas: 100% (18527/18527), done.
Submodule path 'ncnn/glslang': checked out '88fd417b0bb7d91755961c70e846d274c182f2b0'
Submodule path 'ncnn/python/pybind11': checked out '80dc998efced8ceb2be59756668a7e90e8bef917'
Submodule path 'stable-diffusion': checked out 'bac5d4a71a442e9e9fab4a1e30ca203a7c7d3272'
cd go-stable-diffusion && git checkout -b build c0748eca3642d58bcf9521108bcee46959c647dc && git submodule update --init --recursive --depth 1
Switched to a new branch 'build'
go mod edit -replace github.com/go-skynet/go-llama.cpp=/workspace/go-llama
go mod edit -replace github.com/nomic-ai/gpt4all/gpt4all-bindings/golang=/workspace/gpt4all/gpt4all-bindings/golang
go mod edit -replace github.com/go-skynet/go-gpt2.cpp=/workspace/go-gpt2
go mod edit -replace github.com/donomii/go-rwkv.cpp=/workspace/go-rwkv
go mod edit -replace github.com/ggerganov/whisper.cpp=/workspace/whisper.cpp
go mod edit -replace github.com/go-skynet/go-bert.cpp=/workspace/go-bert
go mod edit -replace github.com/go-skynet/bloomz.cpp=/workspace/bloomz
go mod edit -replace github.com/mudler/go-stable-diffusion=/workspace/go-stable-diffusion
go mod download
There is no go-mod issue.
vscode ➜ /workspace (fix/prepare-sources) $ go mod tidy
go: downloading github.com/stretchr/testify v1.8.1
go: downloading gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
go: downloading github.com/otiai10/mint v1.5.1
go: downloading github.com/golang/protobuf v1.5.3
go: downloading golang.org/x/mod v0.10.0
go: downloading github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading google.golang.org/protobuf v1.28.0
devcontainer OS version
vscode ➜ /workspace (fix/prepare-sources) $ uname -a
Linux c4dbba85fecf 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux
We have a similar issue in devcontainer https://github.com/go-skynet/LocalAI/actions/runs/5000926466/jobs/8958952818?pr=282 with make -C gpt4all/gpt4all-bindings/golang/ libgpt4all.a
Looks good here, however the CI fails
Yes, I checked the CI result, it is related to make -C gpt4all/gpt4all-bindings/golang/ libgpt4all.a, I will look into it.
I have been testing the command sed -ie in many environments including Debian x86_64 and arrch64, macOS M1. However, the command that was changed does not always work well and it can cause errors like lack of file.
And the most important part, the dev-container does not work well with arrch64. So, here I suggest avoiding using aarch64 GNU/Linux container as the development environment.
Currently, we can avoid developing on an arm64/aarch64 container environment.