GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Paddle/python/setup.py.in at develop · carryyu/Paddle Expand file tree/ Copy pathsetup.py.inMore file actions 2067 lines (1786 loc) · 86 KB / Copy pathsetup.py.inFile metadata and controls2067 lines (1786 loc) · 86 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 from __future__ import annotations import subprocess import os import os.path import errno import re import shutil import sys import fnmatch import errno import platform import glob import shlex import ctypes from contextlib import contextmanager from pathlib import Path from setuptools import Command from setuptools import setup, Distribution, Extension from setuptools.command.install import install as InstallCommandBase from setuptools.command.egg_info import egg_info class BinaryDistribution(Distribution): def has_ext_modules(foo): return True RC = 0 ext_name = '.dll' if os.name == 'nt' else ('.dylib' if sys.platform == 'darwin' else '.so') def git_commit() -> str: try: cmd = ['git', 'rev-parse', 'HEAD'] git_commit = subprocess.Popen(cmd, stdout = subprocess.PIPE, cwd="@PADDLE_SOURCE_DIR@").communicate()[0].strip() except: git_commit = 'Unknown' git_commit = git_commit.decode() return str(git_commit) def _get_version_detail(idx): assert idx < 3, "version info consists of %(major)d.%(minor)d.%(patch)d, \ so detail index must less than 3" if re.match(r'@TAG_VERSION_REGEX@', '@PADDLE_VERSION@'): version_details = '@PADDLE_VERSION@'.split('.') if len(version_details) >= 3: return version_details[idx] return 0 def get_major() -> int: return int(_get_version_detail(0)) def get_minor() -> int: return int(_get_version_detail(1)) def get_nccl_version() -> int: if '@WITH_NCCL@' == 'ON': return @NCCL_VERSION@ return 0 def get_patch() -> str: return str(_get_version_detail(2)) def get_cuda_version() -> str: if '@WITH_GPU@' == 'ON': return '@CUDA_VERSION@' else: return 'False' def get_hip_version() -> str | None: with_hip = '@WITH_ROCM@' if with_hip == 'ON': return str('@HIP_VERSION@') else: return None def get_cudnn_version() -> str: if '@WITH_GPU@' == 'ON': temp_cudnn_version = '' if '@CUDNN_MAJOR_VERSION@': temp_cudnn_version += '@CUDNN_MAJOR_VERSION@' if '@CUDNN_MINOR_VERSION@': temp_cudnn_version += '.@CUDNN_MINOR_VERSION@' if '@CUDNN_PATCHLEVEL_VERSION@': temp_cudnn_version += '.@CUDNN_PATCHLEVEL_VERSION@' return temp_cudnn_version else: return 'False' def get_xpu_xre_version() -> str: if '@WITH_XPU@' == 'ON': return '@XPU_XRE_BASE_VERSION@' else: return 'False' def get_xpu_xccl_version() -> str: if '@WITH_XPU_BKCL@' == 'ON': return '@XPU_XCCL_BASE_VERSION@' else: return 'False' def get_xpu_xhpc_version() -> str: if '@WITH_XPU@' == 'ON': return '@XPU_XHPC_BASE_DATE@' else: return 'False' def is_tagged() -> bool: try: cmd = ['git', 'describe', '--exact-match', '--tags', 'HEAD', '2>/dev/null'] git_tag = subprocess.Popen(cmd, stdout = subprocess.PIPE, cwd="@PADDLE_SOURCE_DIR@").communicate()[0].strip() git_tag = git_tag.decode() except: return False if str(git_tag).replace('v', '') == '@PADDLE_VERSION@': return True else: return False def get_cinn_version() -> str: if '@WITH_CINN@' != 'ON': return "False" return "0.3.0" def get_cuda_archs() -> list[int]: compiled_cuda_archs = '@COMPILED_CUDA_ARCHS@' if isinstance(compiled_cuda_archs, str): compiled_cuda_archs = re.findall(r'\d+', compiled_cuda_archs) return [int(arch) for arch in compiled_cuda_archs] else: return [] def get_tensorrt_version() -> str: def find_libnvinfer(): """Search for libnvinfer.so file in LD_LIBRARY_PATH.""" tensorrt_library_path='@TENSORRT_LIBRARY_DIR@' trt_infer_rt_path='@TR_INFER_RT@' libnvinfer_file =os.path.join(tensorrt_library_path,trt_infer_rt_path) if os.path.exists(libnvinfer_file): return libnvinfer_file else: print(f"{libnvinfer_file} not found.") return None try: libnvinfer_path = find_libnvinfer() if not libnvinfer_path: return None trt = ctypes.CDLL(libnvinfer_path) get_version =trt.getInferLibVersion get_version.restype = ctypes.c_int version = get_version() version_str = str(version) major = version_str[:1] if len(version_str) > 1 else version_str minor = version_str[1:2] if len(version_str) > 3 else version_str[1:] patch = version_str[3:] if len(version_str) > 3 else '' minor = minor if minor else '0' patch = patch if patch else '0' version_str = f"{major}.{minor}.{patch}" return version_str except Exception as e: print(f"Error while getting TensorRT version: {e}") return None def get_paddle_version() -> str: return '@PADDLE_VERSION@' def write_version_py(filename='paddle/version/__init__.py'): cnt = '''# THIS FILE IS GENERATED FROM PADDLEPADDLE SETUP.PY # import inspect full_version = '%(paddle_version)s' major = '%(major)d' minor = '%(minor)d' patch = '%(patch)s' nccl_version = '%(nccl)d' rc = '%(rc)d' cuda_version = '%(cuda)s' cudnn_version = '%(cudnn)s' hip_version = %(hip)s xpu_xre_version = '%(xpu_xre)s' xpu_xccl_version = '%(xpu_xccl)s' xpu_xhpc_version = '%(xpu_xhpc)s' is_tagged = %(is_tagged)s commit = '%(commit)s' with_mkl = '%(with_mkl)s' with_hml = '%(with_hml)s' cinn_version = '%(cinn)s' tensorrt_version = '%(tensorrt)s' with_pip_cuda_libraries = '%(with_pip_cuda_libraries)s' with_pip_tensorrt ='%(with_pip_tensorrt)s' compiled_cuda_archs = %(compiled_cuda_archs)s __all__ = ['cuda', 'cudnn', 'nccl', 'show', 'xpu', 'xpu_xre', 'xpu_xccl', 'xpu_xhpc', 'tensorrt', 'cuda_archs', 'hip'] def show() -> None: """Get the version of paddle if `paddle` package if tagged. Otherwise, output the corresponding commit id. Returns: If paddle package is not tagged, the commit-id of paddle will be output. Otherwise, the following information will be output. full_version: version of paddle major: the major version of paddle minor: the minor version of paddle patch: the patch level version of paddle rc: whether it's rc version cuda: the cuda version of package. It will return `False` if CPU version paddle package is installed cudnn: the cudnn version of package. It will return `False` if CPU version paddle package is installed xpu_xre: the xpu xre version of package. It will return `False` if non-XPU version paddle package is installed xpu_xccl: the xpu xccl version of package. It will return `False` if non-XPU version paddle package is installed xpu_xhpc: the xpu xhpc version of package. It will return `False` if non-XPU version paddle package is installed cinn: the cinn version of package. It will return `False` if paddle package is not compiled with CINN Examples: .. code-block:: pycon >>> import paddle >>> # Case 1: paddle is tagged with 2.2.0 >>> paddle.version.show() >>> # doctest: +SKIP('Different environments yield different output.') full_version: 2.2.0 major: 2 minor: 2 patch: 0 rc: 0 cuda: '10.2' cudnn: '7.6.5' xpu_xre: '4.32.0.1' xpu_xccl: '1.0.7' xpu_xhpc: '20231208' cinn: False >>> # doctest: -SKIP >>> # Case 2: paddle is not tagged >>> paddle.version.show() >>> # doctest: +SKIP('Different environments yield different output.') commit: cfa357e984bfd2ffa16820e354020529df434f7d cuda: '10.2' cudnn: '7.6.5' xpu_xre: '4.32.0.1' xpu_xccl: '1.0.7' xpu_xhpc: '20231208' cinn: False >>> # doctest: -SKIP """ if is_tagged: print('full_version:', full_version) print('major:', major) print('minor:', minor) print('patch:', patch) print('rc:', rc) else: print('commit:', commit) print('cuda:', cuda_version) print('cudnn:', cudnn_version) print('hip:', hip_version) print('nccl:', nccl_version) print('xpu_xre:', xpu_xre_version) print('xpu_xccl:', xpu_xccl_version) print('xpu_xhpc:', xpu_xhpc_version) print('cinn:', cinn_version) print('tensorrt:', tensorrt_version) print('cuda_archs:', compiled_cuda_archs) def mkl() -> str: return with_mkl def hml() -> str: return with_hml def nccl() -> str: """Get nccl version of paddle package. Returns: string: Return the version information of cuda nccl. If paddle package is CPU version, it will return False. Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.nccl() >>> # doctest: +SKIP('Different environments yield different output.') '2804' """ return nccl_version import inspect CUDA_FUNC_DOC = """Get cuda version of paddle package. Returns: string: Return the version information of cuda. If paddle package is CPU version, it will return False. Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.cuda() >>> # doctest: +SKIP('Different environments yield different output.') '10.2' """ class CudaVersion(str): def __new__(cls, version: str): return super().__new__(cls, version) def __call__(self) -> str: # When users check for GPU devices using paddle.version.cuda is None, we cannot align this behavior with other frameworks . # Note: This discrepancy arises because the is operator checks for object identity (memory address equality) rather than value equality. return str(self) def __repr__(self) -> str: return f"CudaVersion('{self}')" @property def __doc__(self): return CUDA_FUNC_DOC @property def __signature__(self): return inspect.Signature( parameters=[], return_annotation=str ) cuda = CudaVersion(cuda_version) def cudnn() -> str: """Get cudnn version of paddle package. Returns: string: Return the version information of cudnn. If paddle package is CPU version, it will return False. Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.cudnn() >>> # doctest: +SKIP('Different environments yield different output.') '7.6.5' """ return cudnn_version def xpu() -> str: """Get xpu version of paddle package. The API is deprecated now, please use xpu_xhpc() instead. Returns: string: Return the version information of xpu. If paddle package is non-XPU version, it will return False. Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.xpu() >>> # doctest: +SKIP('Different environments yield different output.') '20230114' """ return xpu_xhpc_version def xpu_xre() -> str: """Get xpu xre version of paddle package. Returns: string: Return the version information of xpu. If paddle package is non-XPU version, it will return False. Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.xpu_xre() >>> # doctest: +SKIP('Different environments yield different output.') '4.32.0.1' """ return xpu_xre_version def xpu_xccl() -> str: """Get xpu xccl version of paddle package. Returns: string: Return the version information of xpu xccl. If paddle package is non-XPU version, it will return False. Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.xpu_xccl() >>> # doctest: +SKIP('Different environments yield different output.') '1.0.7' """ return xpu_xccl_version def xpu_xhpc() -> str: """Get xpu xhpc version of paddle package. Returns: string: Return the version information of xpu xhpc. If paddle package is non-XPU version, it will return False. Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.xpu_xhpc() >>> # doctest: +SKIP('Different environments yield different output.') '20231208' """ return xpu_xhpc_version def cinn() -> str: """Get CINN version of paddle package. Returns: string: Return the version information of CINN. If paddle package is not compiled with CINN, it will return False. Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.cinn() >>> # doctest: +SKIP('Different environments yield different output.') False """ return cinn_version def tensorrt() -> str: """Get TensorRT version of paddle package. Returns: string: Return the version information of TensorRT. If paddle package is not compiled with TensorRT, it will return False. Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.tensorrt() >>> # doctest: +SKIP('Different environments yield different output.') False """ return tensorrt_version hip = hip_version def cuda_archs(): """Get compiled cuda archs of paddle package. Returns: list[int]: Return the compiled cuda archs if with gpu. If paddle package is not compiled with gpu, it will return "". Examples: .. code-block:: pycon >>> import paddle >>> paddle.version.cuda_archs() >>> # doctest: +SKIP('Different environments yield different output.') [86] """ return compiled_cuda_archs ''' commit = git_commit() dirname = os.path.dirname(filename) try: os.makedirs(dirname) except OSError as e: if e.errno != errno.EEXIST: raise with open(filename, 'w') as f: f.write(cnt % { 'paddle_version': get_paddle_version(), 'major': get_major(), 'minor': get_minor(), 'patch': get_patch(), 'nccl': get_nccl_version(), 'rc': RC, 'version': '${PADDLE_VERSION}', 'cuda': get_cuda_version(), 'cudnn': get_cudnn_version(), 'hip': get_hip_version(), 'xpu_xre': get_xpu_xre_version(), 'xpu_xccl': get_xpu_xccl_version(), 'xpu_xhpc': get_xpu_xhpc_version(), 'commit': commit, 'is_tagged': is_tagged(), 'with_mkl': '@WITH_MKL@', 'with_hml': '@WITH_HML@', 'cinn': get_cinn_version(), 'tensorrt': get_tensorrt_version(), 'with_pip_tensorrt': '@WITH_PIP_TENSORRT@', 'compiled_cuda_archs': get_cuda_archs(), 'with_pip_cuda_libraries': '@WITH_PIP_CUDA_LIBRARIES@'}) def get_cinn_config_jsons(): from pathlib import Path src_cinn_config_path = '${PADDLE_SOURCE_DIR}/python/paddle/cinn_config' prefix_len = len(src_cinn_config_path) + 1 p = Path(src_cinn_config_path) json_list = list(p.glob('**/*.json')) json_path_list = [] for json in json_list: json = str(json) json = json[prefix_len:] json_path_list += [json] return json_path_list def get_apy_files(): from pathlib import Path apy_path = '${PADDLE_BINARY_DIR}/python/paddle/apy/' prefix_len = len(apy_path) p = Path(apy_path) file_list = [] for path in p.rglob('*'): if path.is_file(): relative_path = str(path)[prefix_len:] file_list.append(relative_path) return file_list write_version_py(filename='@PADDLE_BINARY_DIR@/python/paddle/version/__init__.py') def write_cuda_env_config_py(filename='paddle/cuda_env.py'): cnt = "" if '${JIT_RELEASE_WHL}' == 'ON': cnt = '''# THIS FILE IS GENERATED FROM PADDLEPADDLE SETUP.PY # import os os.environ['CUDA_CACHE_MAXSIZE'] = '805306368' ''' with open(filename, 'w') as f: f.write(cnt) write_cuda_env_config_py(filename='@PADDLE_BINARY_DIR@/python/paddle/cuda_env.py') def write_distributed_training_mode_py(filename='paddle/incubate/distributed/fleet/parameter_server/version.py'): cnt = ''' # THIS FILE IS GENERATED FROM PADDLEPADDLE SETUP.PY from paddle.incubate.distributed.fleet.base import Mode BUILD_MODE=Mode.%(mode)s def is_transpiler(): return Mode.TRANSPILER == BUILD_MODE ''' dirname = os.path.dirname(filename) try: os.makedirs(dirname) except OSError as e: if e.errno != errno.EEXIST: raise with open(filename, 'w') as f: f.write(cnt % { 'mode': 'TRANSPILER' }) write_distributed_training_mode_py(filename='@PADDLE_BINARY_DIR@/python/paddle/incubate/distributed/fleet/parameter_server/version.py') def get_paddle_extra_install_requirements(): #(Note risemeup1): Paddle will install the pypi cuda package provided by Nvidia, which includes the cuda runtime, cudnn, and cublas. Additionally, it now supports the installation of TensorRT, further enhancing its functionality. This integration simplifies the process as the operation of 'pip install paddle' is no longer dependent on the separate installation of cuda, cudnn, or TensorRT. paddle_cuda_requires = [] paddle_tensorrt_requires = [] if '@WITH_PIP_CUDA_LIBRARIES@' == 'ON': if platform.system() == 'Linux': PADDLE_CUDA_INSTALL_REQUIREMENTS = { "11.8": ( "nvidia-cuda-runtime-cu11==11.8.89; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-cupti-cu11==11.8.87; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cudnn-cu11==8.9.6.50; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cublas-cu11==11.11.3.6; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufft-cu11==10.9.0.58; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-curand-cu11==10.3.0.86; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusolver-cu11==11.4.1.48; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparse-cu11==11.7.5.86; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nccl-cu11==2.19.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvtx-cu11==11.8.86; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-nvrtc-cu11==11.8.89; platform_system == 'Linux' and platform_machine == 'x86_64'" ), "12.3": ( "nvidia-cuda-runtime-cu12==12.3.101; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-cupti-cu12==12.3.101; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cudnn-cu12==9.1.1.17; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cublas-cu12==12.3.4.1; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufft-cu12==11.2.1.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-curand-cu12==10.3.5.147; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusolver-cu12==11.6.1.9; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparse-cu12==12.3.1.170; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nccl-cu12==2.28.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvtx-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-nvrtc-cu12==12.3.107; platform_system == 'Linux' and platform_machine == 'x86_64'" ), "12.4": ( "nvidia-cuda-nvrtc-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-runtime-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-cupti-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cudnn-cu12==9.1.0.70; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cublas-cu12==12.4.5.8; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufft-cu12==11.2.1.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-curand-cu12==10.3.5.147; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusolver-cu12==11.6.1.9; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparse-cu12==12.3.1.170; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparselt-cu12==0.6.2; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nccl-cu12==2.28.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvtx-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvjitlink-cu12==12.4.127; platform_system == 'Linux' and platform_machine == 'x86_64'" ), "12.6": ( "nvidia-cuda-nvrtc-cu12==12.6.77; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-runtime-cu12==12.6.77; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-cupti-cu12==12.6.80; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cudnn-cu12==9.5.1.17; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cublas-cu12==12.6.4.1; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufft-cu12==11.3.0.4; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-curand-cu12==10.3.7.77; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusolver-cu12==11.7.1.2; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparse-cu12==12.5.4.2; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparselt-cu12==0.6.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nccl-cu12==2.28.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvtx-cu12==12.6.77; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvjitlink-cu12==12.6.85; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufile-cu12==1.11.1.6; platform_system == 'Linux' and platform_machine == 'x86_64'" ), "12.8": ( "nvidia-cuda-nvrtc-cu12==12.8.61; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-runtime-cu12==12.8.57; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-cupti-cu12==12.8.57; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cudnn-cu12==9.7.1.26; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cublas-cu12==12.8.3.14; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufft-cu12==11.3.3.41; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-curand-cu12==10.3.9.55; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusolver-cu12==11.7.2.55; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparse-cu12==12.5.7.53; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparselt-cu12==0.6.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nccl-cu12==2.28.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvtx-cu12==12.8.55; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvjitlink-cu12==12.8.61; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufile-cu12==1.13.0.11; platform_system == 'Linux' and platform_machine == 'x86_64'" ), "12.9": ( "nvidia-cuda-nvrtc-cu12==12.9.41; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-runtime-cu12==12.9.37; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-cupti-cu12==12.9.19; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cudnn-cu12==9.9.0.52; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cublas-cu12==12.9.0.13; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufft-cu12==11.4.0.6; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-curand-cu12==10.3.10.19; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusolver-cu12==11.7.4.40; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparse-cu12==12.5.9.5; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparselt-cu12==0.7.1; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nccl-cu12==2.28.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvtx-cu12==12.9.19; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvjitlink-cu12==12.9.41; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufile-cu12==1.14.0.30; platform_system == 'Linux' and platform_machine == 'x86_64' | " "cuda-python==12.9.4; platform_system == 'Linux' and platform_machine == 'x86_64'" ), "13.0": ( "nvidia-cuda-nvrtc==13.0.88; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-runtime==13.0.88; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cuda-cupti==13.0.85; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cudnn-cu13==9.13.0.50; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cublas==13.0.2.14; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufft==12.0.0.61; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-curand==10.4.0.35; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusolver==12.0.4.66; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparse==12.6.3.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cusparselt-cu13==0.8.1; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nccl-cu13==2.28.3; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvtx==13.0.85; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-nvjitlink==13.0.88; platform_system == 'Linux' and platform_machine == 'x86_64' | " "nvidia-cufile==1.15.1.6; platform_system == 'Linux' and platform_machine == 'x86_64' | " "cuda-python==13.0.3; platform_system == 'Linux' and platform_machine == 'x86_64'" ), } if '@WITH_CINN@' == 'ON': PADDLE_CUDA_INSTALL_REQUIREMENTS["12.3"] += ( " | nvidia-cuda-cccl-cu12==12.3.52;platform_system == 'Linux' and platform_machine == 'x86_64' " ) PADDLE_CUDA_INSTALL_REQUIREMENTS["12.4"] += ( " | nvidia-cuda-cccl-cu12==12.4.99;platform_system == 'Linux' and platform_machine == 'x86_64' " ) PADDLE_CUDA_INSTALL_REQUIREMENTS["12.6"] += ( " | nvidia-cuda-cccl-cu12==12.6.77;platform_system == 'Linux' and platform_machine == 'x86_64' " ) PADDLE_CUDA_INSTALL_REQUIREMENTS["12.8"] += ( " | nvidia-cuda-cccl-cu12==12.8.90;platform_system == 'Linux' and platform_machine == 'x86_64' " ) PADDLE_CUDA_INSTALL_REQUIREMENTS["12.9"] += ( " | nvidia-cuda-cccl-cu12==12.9.27;platform_system == 'Linux' and platform_machine == 'x86_64' " ) PADDLE_CUDA_INSTALL_REQUIREMENTS["13.0"] += ( " | nvidia-cuda-cccl==13.0.85;platform_system == 'Linux' and platform_machine == 'x86_64' " ) elif platform.system() == 'Windows': PADDLE_CUDA_INSTALL_REQUIREMENTS = { "11.8": ( "nvidia-cuda-runtime-cu11==11.8.89 | " "nvidia-cudnn-cu11==8.9.4.19 | " "nvidia-cublas-cu11==11.11.3.6 | " "nvidia-cufft-cu11==10.9.0.58 | " "nvidia-curand-cu11==10.3.0.86 | " "nvidia-cusolver-cu11==11.4.1.48 | " "nvidia-cusparse-cu11==11.7.5.86 " ), "12.3": ( "nvidia-cuda-runtime-cu12==12.3.101 | " "nvidia-cudnn-cu12==9.1.1.17 | " "nvidia-cublas-cu12==12.3.4.1 | " "nvidia-cufft-cu12==11.2.1.3 | " "nvidia-curand-cu12==10.3.5.147 | " "nvidia-cusolver-cu12==11.6.1.9 | " "nvidia-cusparse-cu12==12.3.1.170 " ), "12.6": ( "nvidia-cuda-runtime-cu12==12.6.77 | " "nvidia-cudnn-cu12==9.5.1.17 | " "nvidia-cublas-cu12==12.6.4.1 | " "nvidia-cufft-cu12==11.3.0.4 | " "nvidia-curand-cu12==10.3.7.77 | " "nvidia-cusolver-cu12==11.7.1.2 | " "nvidia-cusparse-cu12==12.5.4.2 " ), "12.8": ( "nvidia-cuda-runtime-cu12==12.8.57 | " "nvidia-cudnn-cu12==9.7.1.26 | " "nvidia-cublas-cu12==12.8.3.14 | " "nvidia-cufft-cu12==11.3.3.41 | " "nvidia-curand-cu12==10.3.9.55 | " "nvidia-cusolver-cu12==11.7.2.55 | " "nvidia-cusparse-cu12==12.5.7.53 " ), "12.9": ( "nvidia-cuda-runtime-cu12==12.9.37 | " "nvidia-cudnn-cu12==9.9.0.52 | " "nvidia-cublas-cu12==12.9.0.13 | " "nvidia-cufft-cu12==11.4.0.6 | " "nvidia-curand-cu12==10.3.10.19 | " "nvidia-cusolver-cu12==11.7.4.40 | " "nvidia-cusparse-cu12==12.5.9.5 " ), "13.0": ( "nvidia-cuda-runtime==13.0.88 | " "nvidia-cudnn-cu13==9.13.0.50 | " "nvidia-cublas==13.0.2.14 | " "nvidia-cufft==12.0.0.61 | " "nvidia-curand==10.4.0.35 | " "nvidia-cusolver==12.0.4.66 | " "nvidia-cusparse==12.6.3.3 " ) } try: output = subprocess.check_output(['nvcc', '--version']).decode('utf-8') version_line = [line for line in output.split('\n') if 'release' in line][0] match = re.search(r'release ([\d\.]+)', version_line) cuda_major_version = match.group(1) except Exception as e: raise ValueError("CUDA not found") if cuda_major_version in PADDLE_CUDA_INSTALL_REQUIREMENTS: paddle_cuda_requires = PADDLE_CUDA_INSTALL_REQUIREMENTS[cuda_major_version].split("|") if '@WITH_PIP_TENSORRT@' == 'ON': version_str = get_tensorrt_version() version_default = int(version_str.split(".")[0]) if platform.system() =='Linux' or (platform.system()=='Windows' and version_default>=10): PADDLE_TENSORRT_INSTALL_REQUIREMENTS = [ "tensorrt==8.5.3.1", "tensorrt==8.6.0", "tensorrt==8.6.1.post1", "tensorrt==10.3.0", ] if not version_str: return paddle_cuda_requires,[] version_main = ".".join(version_str.split(".")[:3]) matched_package = None for paddle_tensorrt_requires in PADDLE_TENSORRT_INSTALL_REQUIREMENTS: paddle_tensorrt_version = paddle_tensorrt_requires.split("==")[1] paddle_tensorrt_main = ".".join(paddle_tensorrt_version.split(".")[:3]) if version_main == paddle_tensorrt_main: matched_package = paddle_tensorrt_requires break if matched_package: paddle_tensorrt_requires = [matched_package] else: print( f"No exact match found for TensorRT Version: {version_str}. We currently support TensorRT versions 8.5.3.1, 8.6.0, and 8.6.1." ) return paddle_cuda_requires, [] return paddle_cuda_requires,paddle_tensorrt_requires def build_cutlass3_src_code(): target_path = "${PADDLE_BINARY_DIR}/python/paddle/apy/matmul_pass/matmul/cutlass-3.7.0" if not os.path.exists(target_path): os.mkdir(target_path) try: cmd = ['git', 'rev-parse', 'HEAD'] git_commit = subprocess.Popen(cmd, stdout = subprocess.PIPE, cwd="${PADDLE_SOURCE_DIR}/third_party/cutlass").communicate()[0].strip() except: git_commit = 'Unknown' raise Exception("obtain commit id of third_party cutlass failed") commit_id = str(git_commit.decode()) command = ( 'cd ' + '${PADDLE_SOURCE_DIR}/third_party/cutlass && ' + 'git checkout v3.7.0 && ' + 'cp ' + '${PADDLE_SOURCE_DIR}/third_party/cutlass/tools -r ' + f'{target_path} && ' + 'cp ' + '${PADDLE_SOURCE_DIR}/third_party/cutlass/include -r ' + f'{target_path} && ' + f'git checkout {commit_id}' ) if os.system(command) != 0: raise Exception(f"copy cutlass-3.7.0 failed, command: {command}") packages=['paddle', 'paddle.libs', 'paddle.utils', 'paddle.utils.gast', 'paddle.utils.cpp_extension', 'paddle.dataset', 'paddle.reader', 'paddle.distributed', 'paddle.distributed.flex_checkpoint', 'paddle.distributed.flex_checkpoint.aoa', 'paddle.distributed.flex_checkpoint.dcp', 'paddle.distributed.communication', 'paddle.distributed.communication.stream', 'paddle.distributed.metric', 'paddle.distributed.ps', 'paddle.distributed.ps.utils', 'paddle.incubate', 'paddle.incubate.jit', 'paddle.incubate.autograd', 'paddle.incubate.optimizer', 'paddle.incubate.checkpoint', 'paddle.incubate.operators', 'paddle.incubate.tensor', 'paddle.incubate.multiprocessing', 'paddle.incubate.nn', 'paddle.incubate.asp', 'paddle.incubate.passes', 'paddle.incubate.framework', 'paddle.distribution', 'paddle.distributed.utils', 'paddle.distributed.sharding', 'paddle.distributed.fsdp', 'paddle.distributed.fleet', 'paddle.distributed.launch', 'paddle.distributed.auto_tuner', 'paddle.distributed.launch.context', 'paddle.distributed.launch.controllers', 'paddle.distributed.launch.job', 'paddle.distributed.launch.plugins', 'paddle.distributed.launch.utils', 'paddle.distributed.fleet.base', 'paddle.distributed.fleet.recompute', 'paddle.distributed.fleet.elastic', 'paddle.distributed.fleet.meta_optimizers', 'paddle.distributed.fleet.meta_optimizers.sharding', 'paddle.distributed.fleet.meta_optimizers.dygraph_optimizer', 'paddle.distributed.fleet.runtime', 'paddle.distributed.rpc', 'paddle.distributed.fleet.dataset', 'paddle.distributed.fleet.data_generator', 'paddle.distributed.fleet.metrics', 'paddle.distributed.fleet.proto', 'paddle.distributed.fleet.utils', 'paddle.distributed.fleet.layers', 'paddle.distributed.fleet.layers.mpu', 'paddle.distributed.fleet.meta_parallel', 'paddle.distributed.fleet.meta_parallel.pp_utils', 'paddle.distributed.fleet.meta_parallel.sharding', 'paddle.distributed.fleet.meta_parallel.parallel_layers', 'paddle.distributed.auto_parallel', 'paddle.distributed.auto_parallel.intermediate', 'paddle.distributed.auto_parallel.pipelining', 'paddle.distributed.auto_parallel.dygraph', 'paddle.distributed.auto_parallel.static', 'paddle.distributed.auto_parallel.static.operators', 'paddle.distributed.auto_parallel.static.tuner', 'paddle.distributed.auto_parallel.static.cost', 'paddle.distributed.auto_parallel.static.reshard_funcs', 'paddle.distributed.passes', 'paddle.distributed.passes.pipeline_scheduler_pass', 'paddle.distributed.models', 'paddle.distributed.models.moe', 'paddle.distributed.transpiler', 'paddle.distributed.transpiler.details', 'paddle.framework', 'paddle.jit', 'paddle.jit.dy2static', 'paddle.jit.dy2static.transformers', 'paddle.jit.sot', 'paddle.jit.sot.opcode_translator', 'paddle.jit.sot.opcode_translator.executor', 'paddle.jit.sot.opcode_translator.executor.variables', 'paddle.jit.sot.opcode_translator.instruction_utils', 'paddle.jit.sot.profiler', 'paddle.jit.sot.symbolic', 'paddle.jit.sot.symbolic_shape', 'paddle.jit.sot.utils', 'paddle.inference', 'paddle.inference.contrib', 'paddle.inference.contrib.utils', 'paddle.base', 'paddle.base.dygraph', 'paddle.base.proto', 'paddle.base.proto.profiler', 'paddle.base.layers', 'paddle.base.incubate', 'paddle.incubate.distributed.fleet', 'paddle.base.incubate.checkpoint', 'paddle.amp', 'paddle.cost_model', 'paddle.cinn_config', 'paddle.hapi', 'paddle.vision', 'paddle.vision.models', 'paddle.vision.transforms', 'paddle.vision.datasets', 'paddle.audio', 'paddle.audio.functional', 'paddle.audio.features', 'paddle.audio.datasets', 'paddle.audio.backends', 'paddle.text', 'paddle.text.datasets', 'paddle.incubate', 'paddle.incubate.cc', 'paddle.incubate.cc.ap', 'paddle.incubate.cc.tools', 'paddle.apy', 'paddle.incubate.jit', 'paddle.incubate.nn', 'paddle.incubate.nn.functional', 'paddle.incubate.nn.layer', 'paddle.incubate.optimizer.functional', 'paddle.incubate.autograd', 'paddle.incubate.distributed', |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |