tpu-ppl


Nametpu-ppl JSON
Version 1.6.15 PyPI version JSON
download
home_pagehttps://github.com/sophgo/PPL/
SummaryA language and compiler for custom Deep Learning operations
upload_time2025-10-21 11:32:52
maintainerNone
docs_urlNone
authorliang.chen
requires_python>=3.8
license2-Clause BSD
keywords compiler deep learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## ppl
Primitive Programming Language

## Build instructions

### Requirements
- Working C and C++ toolchains(compiler[clang], linker)
- cmake
- ninja

### 1. install git lfs

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash

sudo apt-get install git-lfs

#### setting up lfs for the first time
git lfs install

### 2. clone PPL

#### 2.1 If you had not pull code using the ssh method:
git config --global http.sslVerify false
git clone <ppl repo url>
git config --global http.sslVerify true

#### 2.2 If you had pull code using the ssh method:
##### Change ssh to http
git remote set-url origin https://<your_name>@<ppl repo url>

#### 2.3 set up for http
##### 2.3.1 set http repo
cd ppl

##### 2.3.2 Disable Locked Authentication
git config lfs.https://gerrit-ai.so#ph#go.vip/ppl.git/info/lfs.locksverify false

##### 2.3.3 Local disk to save credentials (have security risk, but no need to enter a password every time you interact with the remote library)
##### note : If you have changed your password, just execute the following statement
git config --global credential.helper store

##### 2.3.4 Skip ssl certificate verification
git config http.sslVerify false

##### 2.3.5 When you change the password, you need to execute the statement below to update the locally saved password
git config --global credential.helper store

### 3. Get the LFS objects contained in the current commit
git lfs fetch
git lfs checkout
or:
git lfs pull

### 4. If need update runtime
source envsetup.sh
git config --global http.sslVerify false (suggested update outside docker)
git submodule update --init
git config --global http.sslVerify true
./update.sh

### 5. How to use git lfs
refer to: https://wiki.so#ph#go.com/pages/viewpage.action?pageId=127019078

### 6. Install LLVM, MLIR, Clang, and PPL

#### Using LLVM release files

download llvm+mlir-17.0.0-x86_64-linux-gnu-ubuntu-18.04-release.tar.gz to third_party
``` sh
cd ppl/third_party
scp guest@172.22.12.22:/data/ppl_third_party/llvm+mlir-17.0.0-x86_64-linux-gnu-ubuntu-18.04-release.tar.gz .
(password:123456)
tar -xvhf llvm+mlir-17.0.0-x86_64-linux-gnu-ubuntu-18.04-release.tar.gz
ln -sf llvm+mlir-17.0.0-x86_64-linux-gnu-ubuntu-18.04-release llvm_release
```

### 7. build ppl
``` sh
cd ppl
./build.sh
# ./build.sh DEBUG (debug mode)
```

## Push Code
```
cd existing_repo
git pull -r
git push origin HEAD:refs/for/main
```

## Run

ppl-compile
options:
--function : function need to be converted
--I : include search path
--print-debug-info : print loc information
--print-ir : print ir
--gen-ref : generate reference groups
--chip : chip type
--x : treat input as language
--O0 : Optimisation level 0: none optimisation
--O1 : Optimisation level 1: do ppl canonicalize
--O2 : Optimisation level 2: do ppl pipeline and ppl canonicalize
--O3 : Optimisation level 3: do all ppl optimisation
--o : Output path for ir and c files
--pm-enable-printing : Enable printing of IR before and after all passed

## Test
You can use the script named ppl_compile.py to test the xx.pl file

For example:
you can test xx.pl by executing the following command.

ppl_compile.py --src ./examples/matmul/mm2.pl --chip bm1684x --gen_test

## Profiling

### preprare PerfAI tool

download PerfAI tool from FTP:172.28.141.89  /perfAI_release/perfAI_release
mv PerfAI_Release_xxx.tar.gz to ppl/third_party
tar -xvhf PerfAI_Release_xxx.tar.gz
ln -sf PerfAI_Release_xxx.tar.gz PerfAI
cd PerfAI
pip install -r requirements.txt

### run

cd ppl/third_party/PerfAI/
source envsetup.sh
ppl_compile.py --src examples/sdma/add_c_dual_loop.pl --chip bm1690 --profiling

profiling files will generate in test_add_c_dual_loop/profiling


## CI
git clone ssh://liang.chen@gerrit-ai.so#ph#go.vip:29418/jenkins_pipeline.git

jenkins script
regression/ppl_ci_test.groovy

dockerfile
envsetup/docker/ppl_dailybuild.dockerfile

## third-party version
triton 5df904233c11a65bd131ead7268f84cca7804275
llvm 2538e550420f

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sophgo/PPL/",
    "name": "tpu-ppl",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Compiler, Deep Learning",
    "author": "liang.chen",
    "author_email": "liang.chen@sophgo.com",
    "download_url": null,
    "platform": null,
    "description": "## ppl\nPrimitive Programming Language\n\n## Build instructions\n\n### Requirements\n- Working C and C++ toolchains(compiler[clang], linker)\n- cmake\n- ninja\n\n### 1. install git lfs\n\ncurl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash\n\nsudo apt-get install git-lfs\n\n#### setting up lfs for the first time\ngit lfs install\n\n### 2. clone PPL\n\n#### 2.1 If you had not pull code using the ssh method:\ngit config --global http.sslVerify false\ngit clone <ppl repo url>\ngit config --global http.sslVerify true\n\n#### 2.2 If you had pull code using the ssh method:\n##### Change ssh to http\ngit remote set-url origin https://<your_name>@<ppl repo url>\n\n#### 2.3 set up for http\n##### 2.3.1 set http repo\ncd ppl\n\n##### 2.3.2 Disable Locked Authentication\ngit config lfs.https://gerrit-ai.so#ph#go.vip/ppl.git/info/lfs.locksverify false\n\n##### 2.3.3 Local disk to save credentials (have security risk, but no need to enter a password every time you interact with the remote library)\n##### note : If you have changed your password, just execute the following statement\ngit config --global credential.helper store\n\n##### 2.3.4 Skip ssl certificate verification\ngit config http.sslVerify false\n\n##### 2.3.5 When you change the password, you need to execute the statement below to update the locally saved password\ngit config --global credential.helper store\n\n### 3. Get the LFS objects contained in the current commit\ngit lfs fetch\ngit lfs checkout\nor:\ngit lfs pull\n\n### 4. If need update runtime\nsource envsetup.sh\ngit config --global http.sslVerify false (suggested update outside docker)\ngit submodule update --init\ngit config --global http.sslVerify true\n./update.sh\n\n### 5. How to use git lfs\nrefer to: https://wiki.so#ph#go.com/pages/viewpage.action?pageId=127019078\n\n### 6. Install LLVM, MLIR, Clang, and PPL\n\n#### Using LLVM release files\n\ndownload llvm+mlir-17.0.0-x86_64-linux-gnu-ubuntu-18.04-release.tar.gz to third_party\n``` sh\ncd ppl/third_party\nscp guest@172.22.12.22:/data/ppl_third_party/llvm+mlir-17.0.0-x86_64-linux-gnu-ubuntu-18.04-release.tar.gz .\n(password:123456)\ntar -xvhf llvm+mlir-17.0.0-x86_64-linux-gnu-ubuntu-18.04-release.tar.gz\nln -sf llvm+mlir-17.0.0-x86_64-linux-gnu-ubuntu-18.04-release llvm_release\n```\n\n### 7. build ppl\n``` sh\ncd ppl\n./build.sh\n# ./build.sh DEBUG (debug mode)\n```\n\n## Push Code\n```\ncd existing_repo\ngit pull -r\ngit push origin HEAD:refs/for/main\n```\n\n## Run\n\nppl-compile\noptions:\n--function : function need to be converted\n--I : include search path\n--print-debug-info : print loc information\n--print-ir : print ir\n--gen-ref : generate reference groups\n--chip : chip type\n--x : treat input as language\n--O0 : Optimisation level 0: none optimisation\n--O1 : Optimisation level 1: do ppl canonicalize\n--O2 : Optimisation level 2: do ppl pipeline and ppl canonicalize\n--O3 : Optimisation level 3: do all ppl optimisation\n--o : Output path for ir and c files\n--pm-enable-printing : Enable printing of IR before and after all passed\n\n## Test\nYou can use the script named ppl_compile.py to test the xx.pl file\n\nFor example:\nyou can test xx.pl by executing the following command.\n\nppl_compile.py --src ./examples/matmul/mm2.pl --chip bm1684x --gen_test\n\n## Profiling\n\n### preprare PerfAI tool\n\ndownload PerfAI tool from FTP:172.28.141.89  /perfAI_release/perfAI_release\nmv PerfAI_Release_xxx.tar.gz to ppl/third_party\ntar -xvhf PerfAI_Release_xxx.tar.gz\nln -sf PerfAI_Release_xxx.tar.gz PerfAI\ncd PerfAI\npip install -r requirements.txt\n\n### run\n\ncd ppl/third_party/PerfAI/\nsource envsetup.sh\nppl_compile.py --src examples/sdma/add_c_dual_loop.pl --chip bm1690 --profiling\n\nprofiling files will generate in test_add_c_dual_loop/profiling\n\n\n## CI\ngit clone ssh://liang.chen@gerrit-ai.so#ph#go.vip:29418/jenkins_pipeline.git\n\njenkins script\nregression/ppl_ci_test.groovy\n\ndockerfile\nenvsetup/docker/ppl_dailybuild.dockerfile\n\n## third-party version\ntriton 5df904233c11a65bd131ead7268f84cca7804275\nllvm 2538e550420f\n",
    "bugtrack_url": null,
    "license": "2-Clause BSD",
    "summary": "A language and compiler for custom Deep Learning operations",
    "version": "1.6.15",
    "project_urls": {
        "Homepage": "https://github.com/sophgo/PPL/"
    },
    "split_keywords": [
        "compiler",
        " deep learning"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8d25df79acbb5b9d5b7be35434fb8ecb1b4f592d32365788c1442228d2d9e5a5",
                "md5": "93b88e86d8288fbcc5c8ac7418f47c24",
                "sha256": "9ca656876653248d5c69cbb83240760045edf482bfc099248aaf1f9c3e0bc627"
            },
            "downloads": -1,
            "filename": "tpu_ppl-1.6.15-cp310-cp310-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "93b88e86d8288fbcc5c8ac7418f47c24",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8",
            "size": 76404970,
            "upload_time": "2025-10-21T11:32:52",
            "upload_time_iso_8601": "2025-10-21T11:32:52.853887Z",
            "url": "https://files.pythonhosted.org/packages/8d/25/df79acbb5b9d5b7be35434fb8ecb1b4f592d32365788c1442228d2d9e5a5/tpu_ppl-1.6.15-cp310-cp310-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "76b0edaa1ebee475a25dfc85ed8a1c0ecf8ab60f15a8df63b3155acc27324b12",
                "md5": "6951d3750db1302eed0365e7ea09dbe6",
                "sha256": "8a1ba1c95d2d5783afdb3d4b44e1cc835f0308b7bf829f3da040f1d72ff4132a"
            },
            "downloads": -1,
            "filename": "tpu_ppl-1.6.15-cp311-cp311-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "6951d3750db1302eed0365e7ea09dbe6",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 76406289,
            "upload_time": "2025-10-21T11:34:11",
            "upload_time_iso_8601": "2025-10-21T11:34:11.804255Z",
            "url": "https://files.pythonhosted.org/packages/76/b0/edaa1ebee475a25dfc85ed8a1c0ecf8ab60f15a8df63b3155acc27324b12/tpu_ppl-1.6.15-cp311-cp311-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "259357271cce09a78e086723b5a0dabdc8b774b3a67aee46a7d52af700772c2d",
                "md5": "ea042a43d3e76b423565cbb29f1bada5",
                "sha256": "5fcc02c08721d90805f36346bd3c2b9f79391f026f57de7a88792c0eb02aba16"
            },
            "downloads": -1,
            "filename": "tpu_ppl-1.6.15-cp312-cp312-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "ea042a43d3e76b423565cbb29f1bada5",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.8",
            "size": 76405506,
            "upload_time": "2025-10-21T11:35:29",
            "upload_time_iso_8601": "2025-10-21T11:35:29.398761Z",
            "url": "https://files.pythonhosted.org/packages/25/93/57271cce09a78e086723b5a0dabdc8b774b3a67aee46a7d52af700772c2d/tpu_ppl-1.6.15-cp312-cp312-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7ace7c6ab735edebb3333290a51d4e2b0571eaf086ecd639f79cd93f2c91fa52",
                "md5": "dc4530fbe7d6c4de18d234f331efe348",
                "sha256": "c44fb0927daa39e5db6ed688b47bd92ae289836ad48217a3118508cc61be395b"
            },
            "downloads": -1,
            "filename": "tpu_ppl-1.6.15-cp38-cp38-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "dc4530fbe7d6c4de18d234f331efe348",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 76405157,
            "upload_time": "2025-10-21T11:36:50",
            "upload_time_iso_8601": "2025-10-21T11:36:50.007570Z",
            "url": "https://files.pythonhosted.org/packages/7a/ce/7c6ab735edebb3333290a51d4e2b0571eaf086ecd639f79cd93f2c91fa52/tpu_ppl-1.6.15-cp38-cp38-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "82b7a8c350f217c400e22c0ed3448639cbf9cc5e36b50deb644c5d874ecdb014",
                "md5": "13b287b16238df2e3ee784ba236cbfbd",
                "sha256": "de826886f1af8ba49f2485be6be748fe2ab6c6740536bcf36014a67f343b1dc8"
            },
            "downloads": -1,
            "filename": "tpu_ppl-1.6.15-cp39-cp39-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "13b287b16238df2e3ee784ba236cbfbd",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8",
            "size": 76405279,
            "upload_time": "2025-10-21T11:38:08",
            "upload_time_iso_8601": "2025-10-21T11:38:08.157362Z",
            "url": "https://files.pythonhosted.org/packages/82/b7/a8c350f217c400e22c0ed3448639cbf9cc5e36b50deb644c5d874ecdb014/tpu_ppl-1.6.15-cp39-cp39-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-21 11:32:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sophgo",
    "github_project": "PPL",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tpu-ppl"
}
        
Elapsed time: 2.53258s