LLM: Add python 3.10 llm UT (#9302)
* add py310 test for llm-unit-test. * add py310 llm-unit-tests * add llm-cpp-build-py310 * test * test * test. * test * test * fix deactivate. * fix * fix. * fix * test * test * test * add build chatglm for win. * test. * fix
This commit is contained in:
		
							parent
							
								
									03aa368776
								
							
						
					
					
						commit
						d4ab5904ef
					
				
					 3 changed files with 39 additions and 1 deletions
				
			
		
							
								
								
									
										30
									
								
								.github/workflows/llm-binary-build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										30
									
								
								.github/workflows/llm-binary-build.yml
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -60,6 +60,8 @@ jobs:
 | 
				
			||||||
          yum install -y gcc-toolset-11 cmake git
 | 
					          yum install -y gcc-toolset-11 cmake git
 | 
				
			||||||
          conda remove -n python39 --all -y
 | 
					          conda remove -n python39 --all -y
 | 
				
			||||||
          conda create -n python39 python=3.9 -y
 | 
					          conda create -n python39 python=3.9 -y
 | 
				
			||||||
 | 
					          conda remove -n python310 --all -y
 | 
				
			||||||
 | 
					          conda create -n python310 python=3.10 -y
 | 
				
			||||||
      - uses: actions/checkout@v3
 | 
					      - uses: actions/checkout@v3
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          repository: "intel-analytics/llm.cpp"
 | 
					          repository: "intel-analytics/llm.cpp"
 | 
				
			||||||
| 
						 | 
					@ -103,6 +105,18 @@ jobs:
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          mv src/chatglm/build/main release/main-chatglm_vnni
 | 
					          mv src/chatglm/build/main release/main-chatglm_vnni
 | 
				
			||||||
          mv src/chatglm/build/_C.cpython-39-x86_64-linux-gnu.so release/chatglm_C.cpython-39-x86_64-linux-gnu.so
 | 
					          mv src/chatglm/build/_C.cpython-39-x86_64-linux-gnu.so release/chatglm_C.cpython-39-x86_64-linux-gnu.so
 | 
				
			||||||
 | 
					      - name: Build Chatglm Py310
 | 
				
			||||||
 | 
					        shell: bash
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          source activate python310 || conda activate python310
 | 
				
			||||||
 | 
					          cd src/chatglm
 | 
				
			||||||
 | 
					          rm -r build
 | 
				
			||||||
 | 
					          scl enable gcc-toolset-11 "cmake -B build"
 | 
				
			||||||
 | 
					          scl enable gcc-toolset-11 "cmake --build build --config Release -j"
 | 
				
			||||||
 | 
					      - name: Move Chatglm binaries Py310
 | 
				
			||||||
 | 
					        shell: bash
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          mv src/chatglm/build/_C.cpython-310-x86_64-linux-gnu.so release/chatglm_C.cpython-310-x86_64-linux-gnu.so
 | 
				
			||||||
      - name: Archive build files
 | 
					      - name: Archive build files
 | 
				
			||||||
        uses: actions/upload-artifact@v3
 | 
					        uses: actions/upload-artifact@v3
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
| 
						 | 
					@ -114,6 +128,7 @@ jobs:
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          make clean
 | 
					          make clean
 | 
				
			||||||
          conda remove -n python39 --all -y
 | 
					          conda remove -n python39 --all -y
 | 
				
			||||||
 | 
					          conda remove -n python310 --all -y
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  check-linux-avx512-artifact:
 | 
					  check-linux-avx512-artifact:
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
| 
						 | 
					@ -401,6 +416,21 @@ jobs:
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          mv src/chatglm/build/Release/main.exe release/main-chatglm_vnni.exe
 | 
					          mv src/chatglm/build/Release/main.exe release/main-chatglm_vnni.exe
 | 
				
			||||||
          mv src/chatglm/build/Release/_C.cp39-win_amd64.pyd release/chatglm_C.cp39-win_amd64.pyd
 | 
					          mv src/chatglm/build/Release/_C.cp39-win_amd64.pyd release/chatglm_C.cp39-win_amd64.pyd
 | 
				
			||||||
 | 
					      - name: Set up Python
 | 
				
			||||||
 | 
					        uses: actions/setup-python@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          python-version: "3.10"
 | 
				
			||||||
 | 
					      - name: Build Chatglm Py310
 | 
				
			||||||
 | 
					        shell: powershell
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          cd src/chatglm
 | 
				
			||||||
 | 
					          rm -r build
 | 
				
			||||||
 | 
					          cmake -DAVXVNNI=ON -B build
 | 
				
			||||||
 | 
					          cmake --build build --config Release -j
 | 
				
			||||||
 | 
					      - name: Move Chatglm binaries Py310
 | 
				
			||||||
 | 
					        shell: powershell
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          mv src/chatglm/build/Release/_C.cp310-win_amd64.pyd release/chatglm_C.cp310-win_amd64.pyd
 | 
				
			||||||
      - name: Archive build files
 | 
					      - name: Archive build files
 | 
				
			||||||
        uses: actions/upload-artifact@v3
 | 
					        uses: actions/upload-artifact@v3
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								.github/workflows/llm_unit_tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/llm_unit_tests.yml
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -49,6 +49,12 @@ jobs:
 | 
				
			||||||
          - os: ubuntu-20.04-lts
 | 
					          - os: ubuntu-20.04-lts
 | 
				
			||||||
            instruction: avx512
 | 
					            instruction: avx512
 | 
				
			||||||
            python-version: "3.9"
 | 
					            python-version: "3.9"
 | 
				
			||||||
 | 
					          - os: windows
 | 
				
			||||||
 | 
					            instruction: avx2
 | 
				
			||||||
 | 
					            python-version: "3.10"
 | 
				
			||||||
 | 
					          - os: ubuntu-20.04-lts
 | 
				
			||||||
 | 
					            instruction: avx512
 | 
				
			||||||
 | 
					            python-version: "3.10"
 | 
				
			||||||
    runs-on: [self-hosted, llm, "${{matrix.instruction}}", "${{matrix.os}}"]
 | 
					    runs-on: [self-hosted, llm, "${{matrix.instruction}}", "${{matrix.os}}"]
 | 
				
			||||||
    env:
 | 
					    env:
 | 
				
			||||||
      THREAD_NUM: 24
 | 
					      THREAD_NUM: 24
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -85,7 +85,8 @@ windows_binarys = [
 | 
				
			||||||
    "quantize-starcoder_vnni.exe",
 | 
					    "quantize-starcoder_vnni.exe",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "main-chatglm_vnni.exe",
 | 
					    "main-chatglm_vnni.exe",
 | 
				
			||||||
    "chatglm_C.cp39-win_amd64.pyd"
 | 
					    "chatglm_C.cp39-win_amd64.pyd",
 | 
				
			||||||
 | 
					    "chatglm_C.cp310-win_amd64.pyd"
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
linux_binarys = [
 | 
					linux_binarys = [
 | 
				
			||||||
    "libllama_avx.so",
 | 
					    "libllama_avx.so",
 | 
				
			||||||
| 
						 | 
					@ -124,6 +125,7 @@ linux_binarys = [
 | 
				
			||||||
    "main-chatglm_vnni",
 | 
					    "main-chatglm_vnni",
 | 
				
			||||||
    "main-chatglm_amx",
 | 
					    "main-chatglm_amx",
 | 
				
			||||||
    "chatglm_C.cpython-39-x86_64-linux-gnu.so",
 | 
					    "chatglm_C.cpython-39-x86_64-linux-gnu.so",
 | 
				
			||||||
 | 
					    "chatglm_C.cpython-310-x86_64-linux-gnu.so"
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ext_lib_urls = [
 | 
					ext_lib_urls = [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue