diff --git a/misc/Makefile b/misc/Makefile index 7d8034c8307b..6cc050e71a62 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -1,620 +1,621 @@ COMMENT = Miscellaneous utilities SUBDIR += R-cran-mime SUBDIR += R-cran-xfun SUBDIR += aclgen SUBDIR += actiona SUBDIR += adios2 SUBDIR += aichat SUBDIR += amanda-client SUBDIR += amanda-perl-wrapper SUBDIR += amanda-server SUBDIR += amazon-qldb-shell SUBDIR += ansiweather SUBDIR += apparix SUBDIR += arrow-datafusion SUBDIR += artikulate SUBDIR += asbutton SUBDIR += asr-manpages SUBDIR += astc-encoder SUBDIR += bb SUBDIR += bbjd SUBDIR += bdelta SUBDIR += bestfit SUBDIR += bible-kjv SUBDIR += biblesync SUBDIR += bibletime SUBDIR += biblical-curse SUBDIR += binbloom SUBDIR += binclock SUBDIR += binocle SUBDIR += biosfont-demos SUBDIR += birthday SUBDIR += bogosort SUBDIR += bottlerocket SUBDIR += box2d SUBDIR += boxes SUBDIR += broot SUBDIR += bsod SUBDIR += buffer SUBDIR += caffe SUBDIR += chatgpt-shell-cli SUBDIR += cheat SUBDIR += chef SUBDIR += chmlib SUBDIR += chrono SUBDIR += cinnamon-translations SUBDIR += cldr-emoji-annotation SUBDIR += clex SUBDIR += clifm SUBDIR += cloc SUBDIR += clpbar SUBDIR += colortail SUBDIR += coloursum SUBDIR += colwide SUBDIR += compat.el SUBDIR += compat10x SUBDIR += compat11x SUBDIR += compat12x SUBDIR += compat4x SUBDIR += compat5x SUBDIR += compat6x SUBDIR += compat7x SUBDIR += compat8x SUBDIR += compat9x SUBDIR += concourse SUBDIR += copperspice-examples SUBDIR += countrycodes SUBDIR += cpuid SUBDIR += crosti SUBDIR += cryptoballot SUBDIR += cs SUBDIR += cstream SUBDIR += ctm SUBDIR += cuttlefish SUBDIR += dahdi SUBDIR += dahdi-kmod26 SUBDIR += darknet SUBDIR += dartsim SUBDIR += ddate SUBDIR += deco SUBDIR += dejagnu SUBDIR += delay SUBDIR += diction SUBDIR += digitemp SUBDIR += dijo SUBDIR += dive SUBDIR += dlib-models SUBDIR += dnetc SUBDIR += dotenv-linter SUBDIR += dtach SUBDIR += dvorak7min SUBDIR += dynomite SUBDIR += e2fsprogs-libblkid SUBDIR += e2fsprogs-libuuid SUBDIR += ecflow SUBDIR += edfbrowser SUBDIR += edflib SUBDIR += elki SUBDIR += elscreen SUBDIR += estic SUBDIR += exercism SUBDIR += explosions SUBDIR += ezc3d SUBDIR += far2l SUBDIR += fastscapelib SUBDIR += felis SUBDIR += figlet SUBDIR += figlet-fonts SUBDIR += findutils SUBDIR += firestring SUBDIR += flag SUBDIR += flashlight SUBDIR += fortune-mod-bible SUBDIR += fortune-mod-bofh SUBDIR += fortune-mod-epictetus SUBDIR += fortune-mod-freebsd-classic SUBDIR += fortune-mod-futurama SUBDIR += fortune-mod-psalms SUBDIR += fortuneit SUBDIR += fpc-chm SUBDIR += fq SUBDIR += free42 SUBDIR += freebsd-doc-all SUBDIR += freebsd-doc-bn SUBDIR += freebsd-doc-da SUBDIR += freebsd-doc-de SUBDIR += freebsd-doc-el SUBDIR += freebsd-doc-en SUBDIR += freebsd-doc-es SUBDIR += freebsd-doc-fr SUBDIR += freebsd-doc-hu SUBDIR += freebsd-doc-id SUBDIR += freebsd-doc-it SUBDIR += freebsd-doc-ja SUBDIR += freebsd-doc-ko SUBDIR += freebsd-doc-mn SUBDIR += freebsd-doc-nl SUBDIR += freebsd-doc-pl SUBDIR += freebsd-doc-pt SUBDIR += freebsd-doc-ru SUBDIR += freebsd-doc-tr SUBDIR += freebsd-doc-zh_cn SUBDIR += freebsd-doc-zh_tw SUBDIR += freebsd-release-manifests SUBDIR += freeguide SUBDIR += frugally-deep SUBDIR += ftdi-eeprom SUBDIR += fxload SUBDIR += g810-led SUBDIR += gedkeeper SUBDIR += geekcode SUBDIR += getopt SUBDIR += gimp-help-en SUBDIR += gkrellm-gamma SUBDIR += gkrellm-xkb SUBDIR += gkrellmbgchg2 SUBDIR += gkrellmlaunch2 SUBDIR += gkrellshoot2 SUBDIR += gkx86info2 SUBDIR += global-tz SUBDIR += gnome-devel-docs SUBDIR += gnome-getting-started-docs SUBDIR += gnome-icon-theme SUBDIR += gnome-icon-theme-extras SUBDIR += gnome-mime-data SUBDIR += gnome-user-docs SUBDIR += gnu-watch SUBDIR += gnuls SUBDIR += gobuster SUBDIR += gone SUBDIR += gplink SUBDIR += gpsim SUBDIR += granulate SUBDIR += grc SUBDIR += gwhich SUBDIR += hashdb SUBDIR += hello SUBDIR += help2man SUBDIR += heyu2 SUBDIR += hicolor-icon-theme SUBDIR += histring SUBDIR += hotkeys SUBDIR += hs-hascard SUBDIR += hulgalugha SUBDIR += hwdata SUBDIR += hxtools SUBDIR += ignition-fuel-tools SUBDIR += iio-oscilloscope SUBDIR += imerge SUBDIR += img2xterm SUBDIR += ini_file_manager SUBDIR += inplace SUBDIR += ipa_conv SUBDIR += ipbt SUBDIR += ironscanner SUBDIR += iselect SUBDIR += iso-codes SUBDIR += jargon SUBDIR += jbidwatcher SUBDIR += jojodiff SUBDIR += json-tui SUBDIR += kbdscan SUBDIR += kcd SUBDIR += kde-thumbnailer-chm SUBDIR += kde-thumbnailer-epub SUBDIR += kde-thumbnailer-fb2 SUBDIR += kdeedu SUBDIR += kdeedu-data SUBDIR += kdeutils SUBDIR += kenny SUBDIR += kf5-purpose SUBDIR += kgeography SUBDIR += klettres SUBDIR += kookbook SUBDIR += ktouch SUBDIR += kwordquiz SUBDIR += lastools SUBDIR += latex-mk SUBDIR += lazyread SUBDIR += lbann SUBDIR += lc SUBDIR += lesspipe SUBDIR += lf SUBDIR += libad9361-iio SUBDIR += libcomps SUBDIR += libeatmydata SUBDIR += libemos SUBDIR += libiio SUBDIR += libkeduvocdocument SUBDIR += liblxi SUBDIR += libmetalink SUBDIR += libmodulemd SUBDIR += libpostal SUBDIR += libpredict SUBDIR += libpri SUBDIR += librepo SUBDIR += libsolv SUBDIR += libsupertone SUBDIR += libsweep-lidar SUBDIR += libutf SUBDIR += libxdf SUBDIR += lifelines SUBDIR += lightgbm SUBDIR += lingoteach SUBDIR += locale-en_DK SUBDIR += localedata SUBDIR += logsurfer SUBDIR += lscolors SUBDIR += lv SUBDIR += lxde-common SUBDIR += lxi-tools SUBDIR += magicpoint SUBDIR += man.el SUBDIR += mate-user-guide SUBDIR += mbuffer SUBDIR += mc SUBDIR += mc-nox11 SUBDIR += mdp SUBDIR += meshoptimizer SUBDIR += metalink-checker SUBDIR += metalink-tools SUBDIR += mime-support SUBDIR += minidnn SUBDIR += mirmon SUBDIR += mmdnn SUBDIR += mmv SUBDIR += mnn SUBDIR += molequeue SUBDIR += morse SUBDIR += mtx SUBDIR += mxnet SUBDIR += najitool SUBDIR += ncnn SUBDIR += netron SUBDIR += nms SUBDIR += nn-insight SUBDIR += nnn SUBDIR += nsf SUBDIR += numchar SUBDIR += nut SUBDIR += ompl SUBDIR += ondir SUBDIR += onnx SUBDIR += opencyc SUBDIR += openhab SUBDIR += openhab-addons SUBDIR += openhab2 SUBDIR += openhab2-addons SUBDIR += openhantek SUBDIR += openhmd SUBDIR += openmvg SUBDIR += opennn SUBDIR += openr2 SUBDIR += openvdb SUBDIR += orange3 SUBDIR += orville-write SUBDIR += osinfo-db SUBDIR += ossp-uuid SUBDIR += otter SUBDIR += owrep SUBDIR += p5-Acme-ButFirst SUBDIR += p5-Array-Compare SUBDIR += p5-Array-Diff SUBDIR += p5-Array-FileReader SUBDIR += p5-Array-IntSpan SUBDIR += p5-Array-LineReader SUBDIR += p5-Array-PrintCols SUBDIR += p5-Array-RefElem SUBDIR += p5-Array-Utils SUBDIR += p5-Asterisk-FastAGI SUBDIR += p5-Bot-Training SUBDIR += p5-Bot-Training-MegaHAL SUBDIR += p5-Bot-Training-StarCraft SUBDIR += p5-Business-EDI SUBDIR += p5-Business-Hours SUBDIR += p5-Business-ISBN SUBDIR += p5-Business-ISBN-Data SUBDIR += p5-Business-ISIN SUBDIR += p5-Business-ISMN SUBDIR += p5-Business-ISSN SUBDIR += p5-Business-UPS SUBDIR += p5-Chatbot-Eliza SUBDIR += p5-Data-Buffer SUBDIR += p5-File-CounterFile SUBDIR += p5-File-Sort SUBDIR += p5-Geo-Address-Formatter SUBDIR += p5-Geo-Cache SUBDIR += p5-Geo-Coder-Bing SUBDIR += p5-Geo-Coder-Google SUBDIR += p5-Geo-Coder-Googlev3 SUBDIR += p5-Geo-Coder-Mapquest SUBDIR += p5-Geo-Coder-Multimap SUBDIR += p5-Geo-Coder-Multiple SUBDIR += p5-Geo-Coder-Navteq SUBDIR += p5-Geo-Coder-OSM SUBDIR += p5-Geo-Coder-OpenCage SUBDIR += p5-Geo-Coder-Ovi SUBDIR += p5-Geo-Coder-PlaceFinder SUBDIR += p5-Geo-Coder-TomTom SUBDIR += p5-Geo-GeoNames SUBDIR += p5-Geo-Postcodes SUBDIR += p5-Geo-Postcodes-DK SUBDIR += p5-Geo-Postcodes-NO SUBDIR += p5-Geo-Weather SUBDIR += p5-Geography-Countries SUBDIR += p5-I18N-Charset SUBDIR += p5-I18N-LangTags SUBDIR += p5-LEGO-RCX SUBDIR += p5-Library-CallNumber-LC SUBDIR += p5-List-Compare SUBDIR += p5-List-Util-WeightedRoundRobin SUBDIR += p5-Locale-Codes SUBDIR += p5-Locale-Geocode SUBDIR += p5-Locale-Msgcat SUBDIR += p5-Locale-SubCountry SUBDIR += p5-Locale-US SUBDIR += p5-Net-vCard SUBDIR += p5-OSSP-uuid SUBDIR += p5-OpenAI-API SUBDIR += p5-Software-License SUBDIR += p5-Software-License-CCpack SUBDIR += p5-Test-Dir SUBDIR += p5-Text-FIGlet SUBDIR += p5-Tie-DxHash SUBDIR += p5-Zen-Koans SUBDIR += p5-asterisk-perl SUBDIR += parley SUBDIR += pastebinit SUBDIR += patchutils SUBDIR += pauker SUBDIR += pciids SUBDIR += pdmenu SUBDIR += pear-Services_Weather SUBDIR += pear-Text_Figlet SUBDIR += pecl-timezonedb SUBDIR += perkeep SUBDIR += pfm SUBDIR += php80-calendar SUBDIR += php81-calendar SUBDIR += php82-calendar SUBDIR += pinfo SUBDIR += pipe SUBDIR += posixtestsuite SUBDIR += pqrs SUBDIR += proxyper SUBDIR += pspresent SUBDIR += ptsort SUBDIR += pubs SUBDIR += py-PyUserInput SUBDIR += py-PyWavefront SUBDIR += py-QSpectrumAnalyzer SUBDIR += py-SimpleSoapy SUBDIR += py-SoapySDR SUBDIR += py-alive-progress SUBDIR += py-apache-beam SUBDIR += py-ascii-magic SUBDIR += py-boost-histogram SUBDIR += py-censys SUBDIR += py-cinder SUBDIR += py-colorbrewer SUBDIR += py-colored SUBDIR += py-crudini SUBDIR += py-detecta SUBDIR += py-dictdiffer SUBDIR += py-eemeter SUBDIR += py-einops SUBDIR += py-emoji SUBDIR += py-ezc3d SUBDIR += py-fast-histogram SUBDIR += py-fastscapelib SUBDIR += py-fleep SUBDIR += py-fuzzy SUBDIR += py-gluoncv SUBDIR += py-gluonnlp SUBDIR += py-halo SUBDIR += py-histoprint SUBDIR += py-huepy SUBDIR += py-icoextract SUBDIR += py-ipyfastscape SUBDIR += py-kartograph SUBDIR += py-lightgbm SUBDIR += py-log_symbols SUBDIR += py-mffpy SUBDIR += py-molequeue SUBDIR += py-mxnet SUBDIR += py-numcodecs SUBDIR += py-onnx SUBDIR += py-onnx-tf SUBDIR += py-openai SUBDIR += py-openpaperwork-core SUBDIR += py-openpaperwork-gtk SUBDIR += py-openvdb SUBDIR += py-orange3-associate SUBDIR += py-orange3-datafusion SUBDIR += py-orange3-educational SUBDIR += py-orange3-network SUBDIR += py-orange3-timeseries SUBDIR += py-palettable SUBDIR += py-papermill SUBDIR += py-pexpect SUBDIR += py-placekey SUBDIR += py-powerline-status SUBDIR += py-progressbar SUBDIR += py-progressbar2 SUBDIR += py-pyEDFlib SUBDIR += py-pyct SUBDIR += py-pyfiglet SUBDIR += py-pykml SUBDIR += py-pypatent SUBDIR += py-pyprind SUBDIR += py-python-geohash SUBDIR += py-python-utils + SUBDIR += py-pytorch SUBDIR += py-qiskit-machine-learning SUBDIR += py-scikit-fusion SUBDIR += py-serverfiles SUBDIR += py-shap2 SUBDIR += py-shell-gpt SUBDIR += py-soapy_power SUBDIR += py-spdx SUBDIR += py-spdx-lookup SUBDIR += py-spdx-tools SUBDIR += py-spinners SUBDIR += py-tes SUBDIR += py-tflearn SUBDIR += py-tflite SUBDIR += py-tflite-support SUBDIR += py-toil SUBDIR += py-tqdm SUBDIR += py-tvm SUBDIR += py-uhi SUBDIR += py-wandb SUBDIR += py-wurlitzer SUBDIR += py-xgboost SUBDIR += pyobd SUBDIR += pytorch SUBDIR += qbrew SUBDIR += qlas SUBDIR += qt5-doc SUBDIR += qt5-examples SUBDIR += qt5-l10n SUBDIR += qt5ct SUBDIR += qt6-doc SUBDIR += qt6-examples SUBDIR += qt6ct SUBDIR += quantum++ SUBDIR += raspberrypi-gpioshutdown SUBDIR += raspberrypi-userland SUBDIR += raspbsd-led SUBDIR += ree SUBDIR += rfc SUBDIR += ringtonetools SUBDIR += rname SUBDIR += rpl SUBDIR += rsclock SUBDIR += rtfm SUBDIR += rubygem-dotenv SUBDIR += rubygem-dotenv-rails-rails4 SUBDIR += rubygem-dotenv-rails-rails5 SUBDIR += rubygem-dotenv-rails-rails50 SUBDIR += rubygem-dotenv-rails-rails61 SUBDIR += rubygem-haversine_distance SUBDIR += rubygem-iesd SUBDIR += rubygem-mime-types SUBDIR += rubygem-mime-types-data SUBDIR += rubygem-mimemagic SUBDIR += rubygem-octicons SUBDIR += rubygem-rabbit SUBDIR += rubygem-vpim SUBDIR += rump SUBDIR += ruut SUBDIR += schilytools SUBDIR += sdformat SUBDIR += seabios SUBDIR += sent SUBDIR += seq2 SUBDIR += sfm SUBDIR += shared-mime-info SUBDIR += shc SUBDIR += shuffle SUBDIR += shuffle-db SUBDIR += silicon SUBDIR += since SUBDIR += skyutils SUBDIR += slides SUBDIR += sloccount SUBDIR += sls SUBDIR += smssend SUBDIR += snakemake SUBDIR += soapysdr SUBDIR += solarized SUBDIR += sshbuddy SUBDIR += sssnips SUBDIR += star-history SUBDIR += susv2 SUBDIR += susv3 SUBDIR += susv4 SUBDIR += swissfileknife SUBDIR += sword SUBDIR += table.el SUBDIR += talkfilters SUBDIR += tdfiglet SUBDIR += team SUBDIR += tellico SUBDIR += tempcontrol SUBDIR += termatrix SUBDIR += terminfo-db SUBDIR += teseq SUBDIR += thefuck SUBDIR += thrill SUBDIR += timetrace SUBDIR += timezonemap SUBDIR += tkcron SUBDIR += tkinfo SUBDIR += tkregexp SUBDIR += tkrunit SUBDIR += tlci SUBDIR += toilet SUBDIR += translate SUBDIR += trurl SUBDIR += ttyrec SUBDIR += tudu SUBDIR += tvbrowser SUBDIR += tvm SUBDIR += tzdiff SUBDIR += uk-phone SUBDIR += uk-postcodes SUBDIR += umodunpack SUBDIR += unclutter SUBDIR += unclutter-xfixes SUBDIR += unicode-emoji SUBDIR += upclient SUBDIR += urbit SUBDIR += urh SUBDIR += usbids SUBDIR += usbrh-libusb SUBDIR += usd SUBDIR += utftools SUBDIR += utouch-kmod SUBDIR += valentina SUBDIR += vdmfec SUBDIR += veles SUBDIR += vera SUBDIR += vfc SUBDIR += vifm SUBDIR += visp SUBDIR += viz SUBDIR += vote SUBDIR += vxl SUBDIR += wego SUBDIR += whichman SUBDIR += window SUBDIR += with SUBDIR += wmScoreBoard SUBDIR += wmcalendar SUBDIR += wmforecast SUBDIR += wmjulia SUBDIR += wmpal SUBDIR += wmtunlo SUBDIR += wmweather+ SUBDIR += wmwork SUBDIR += wthrr SUBDIR += xd-rust SUBDIR += xdelta SUBDIR += xdelta3 SUBDIR += xfce4-appfinder SUBDIR += xfce4-weather-plugin SUBDIR += xfce4-wm-themes SUBDIR += xgas SUBDIR += xgboost SUBDIR += xiphos SUBDIR += xless SUBDIR += xosd SUBDIR += xplr SUBDIR += xtail SUBDIR += xtar SUBDIR += ytree SUBDIR += zine SUBDIR += zoneinfo .include diff --git a/misc/py-pytorch/Makefile b/misc/py-pytorch/Makefile new file mode 100644 index 000000000000..67e667515367 --- /dev/null +++ b/misc/py-pytorch/Makefile @@ -0,0 +1,57 @@ +PORTNAME= pytorch +DISTVERSIONPREFIX= v +DISTVERSION= 2.0.0 +CATEGORIES= misc # machine-learning +MASTER_SITES= https://github.com/pytorch/pytorch/releases/download/v${DISTVERSION}/ +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DIST_SUBDIR= ${PORTNAME} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= PyTorch: Tensors and dynamic neural networks in Python +WWW= https://pytorch.org/ + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= cmake:devel/cmake-core \ + gmake:devel/gmake \ + pybind11>0:devel/pybind11 \ + ${LOCALBASE}/include/fxdiv.h:devel/fxdiv \ + ${PYTHON_PKGNAMEPREFIX}typing-extensions>0:devel/py-typing-extensions@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR} +LIB_DEPENDS= libopenblas.so:math/openblas \ + libmpi.so:net/openmpi \ + libonnx.so:misc/onnx \ + libpthreadpool.so:devel/pthreadpool \ + libprotobuf.so:devel/protobuf \ + libsleef.so:math/sleef +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}filelock>0:sysutils/py-filelock@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}networkx>0:math/py-networkx@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}sympy>0:math/py-sympy@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}typing-extensions>0:devel/py-typing-extensions@${PY_FLAVOR} +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}dill>0:devel/py-dill@${PY_FLAVOR} # optional dependency + +USES= compiler:c++14-lang localbase:ldflags python +USE_PYTHON= distutils autoplist + +MAKE_ENV= USE_NINJA=no # ninja breaks for some reason +MAKE_ENV+= BUILD_TEST=0 # ninja breaks for some reason +LDFLAGS+= -lexecinfo + +BINARY_ALIAS= make=${GMAKE} + +POST_PLIST= fix-plist + +post-install: # strip binaries + @${STRIP_CMD} \ + ${STAGEDIR}${PYTHON_SITELIBDIR}/torch/bin/torch_shm_manager \ + ${STAGEDIR}${PYTHON_SITELIBDIR}/torch/_C${PYTHON_EXT_SUFFIX}.so \ + ${STAGEDIR}${PYTHON_SITELIBDIR}/torch/_C_flatbuffer${PYTHON_EXT_SUFFIX}.so \ + ${STAGEDIR}${PYTHON_SITELIBDIR}/functorch/_C${PYTHON_EXT_SUFFIX}.so \ + ${STAGEDIR}${PYTHON_SITELIBDIR}/torch/lib/lib*.so + +fix-plist: # remove the stray %%PYTHON_SITELIBDIR%%/caffe2 file + @${REINPLACE_CMD} -e "s|.*/caffe2$$||" ${TMPPLIST} + +.include diff --git a/misc/py-pytorch/distinfo b/misc/py-pytorch/distinfo new file mode 100644 index 000000000000..7deec686ed14 --- /dev/null +++ b/misc/py-pytorch/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1683446868 +SHA256 (pytorch/pytorch-v2.0.0.tar.gz) = cecc38b6d4256b810336edfc6119d7a57b701fdf1ba43c50001f31e2724fd8e2 +SIZE (pytorch/pytorch-v2.0.0.tar.gz) = 276643781 diff --git a/misc/py-pytorch/files/patch-CMakeLists.txt b/misc/py-pytorch/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..9ebebccbf2e3 --- /dev/null +++ b/misc/py-pytorch/files/patch-CMakeLists.txt @@ -0,0 +1,39 @@ +--- CMakeLists.txt.orig 2023-04-03 19:45:59 UTC ++++ CMakeLists.txt +@@ -138,7 +138,7 @@ endif() + set(CPU_AARCH64 OFF) + set(CPU_INTEL OFF) + +-if(CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|x86_64)") ++if(CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64|x86_64)") + set(CPU_INTEL ON) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)") + set(CPU_AARCH64 ON) +@@ -163,7 +163,7 @@ include(CMakeDependentOption) + option(ATEN_NO_TEST "Do not build ATen test binaries" OFF) + option(BUILD_BINARY "Build C++ binaries" OFF) + option(BUILD_DOCS "Build Caffe2 documentation" OFF) +-option(BUILD_CUSTOM_PROTOBUF "Build and use Caffe2's own protobuf under third_party" ON) ++option(BUILD_CUSTOM_PROTOBUF "Build and use Caffe2's own protobuf under third_party" OFF) + option(BUILD_PYTHON "Build Python binaries" ON) + option(BUILD_CAFFE2 "Master flag to build Caffe2" OFF) + option(BUILD_LITE_INTERPRETER "Master flag to build Lite Interpreter" OFF) +@@ -398,15 +398,15 @@ endif() + # USE_SYSTEM_LIBS being "OFF". + option(USE_SYSTEM_LIBS "Use all available system-provided libraries." OFF) + option(USE_SYSTEM_CPUINFO "Use system-provided cpuinfo." OFF) +-option(USE_SYSTEM_SLEEF "Use system-provided sleef." OFF) ++option(USE_SYSTEM_SLEEF "Use system-provided sleef." ON) + option(USE_SYSTEM_GLOO "Use system-provided gloo." OFF) + option(USE_SYSTEM_FP16 "Use system-provided fp16." OFF) +-option(USE_SYSTEM_PYBIND11 "Use system-provided PyBind11." OFF) ++option(USE_SYSTEM_PYBIND11 "Use system-provided PyBind11." ON) + option(USE_SYSTEM_PTHREADPOOL "Use system-provided pthreadpool." OFF) + option(USE_SYSTEM_PSIMD "Use system-provided psimd." OFF) + option(USE_SYSTEM_FXDIV "Use system-provided fxdiv." OFF) + option(USE_SYSTEM_BENCHMARK "Use system-provided google benchmark." OFF) +-option(USE_SYSTEM_ONNX "Use system-provided onnx." OFF) ++option(USE_SYSTEM_ONNX "Use system-provided onnx." ON) + option(USE_SYSTEM_XNNPACK "Use system-provided xnnpack." OFF) + option(USE_GOLD_LINKER "Use ld.gold to link" OFF) + if(USE_SYSTEM_LIBS) diff --git a/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec256_vec256__bfloat16.h b/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec256_vec256__bfloat16.h new file mode 100644 index 000000000000..1fb789eebb7b --- /dev/null +++ b/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec256_vec256__bfloat16.h @@ -0,0 +1,11 @@ +--- aten/src/ATen/cpu/vec/vec256/vec256_bfloat16.h.orig 2023-05-07 16:59:15 UTC ++++ aten/src/ATen/cpu/vec/vec256/vec256_bfloat16.h +@@ -206,7 +206,7 @@ template <> class Vectorized { (public) + } + return b; + } +- Vectorized map(const __m256 (*const vop)(__m256)) const { ++ Vectorized map(__m256 (*const vop)(__m256)) const { + __m256 lo, hi; + cvtbf16_fp32(values, lo, hi); + const auto o1 = vop(lo); diff --git a/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec512_vec512__bfloat16.h b/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec512_vec512__bfloat16.h new file mode 100644 index 000000000000..59081cf2f2b0 --- /dev/null +++ b/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec512_vec512__bfloat16.h @@ -0,0 +1,11 @@ +--- aten/src/ATen/cpu/vec/vec512/vec512_bfloat16.h.orig 2023-05-07 17:07:36 UTC ++++ aten/src/ATen/cpu/vec/vec512/vec512_bfloat16.h +@@ -283,7 +283,7 @@ template <> class Vectorized { (public) + } + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wignored-qualifiers" +- Vectorized map(const __m512 (*const vop)(__m512)) const { ++ Vectorized map(__m512 (*const vop)(__m512)) const { + __m512 lo, hi; + cvtbf16_fp32(values, lo, hi); + const auto o1 = vop(lo); diff --git a/misc/py-pytorch/files/patch-aten_src_ATen_native_sparse_ValidateCompressedIndicesCommon.h b/misc/py-pytorch/files/patch-aten_src_ATen_native_sparse_ValidateCompressedIndicesCommon.h new file mode 100644 index 000000000000..70dc6fbd61e2 --- /dev/null +++ b/misc/py-pytorch/files/patch-aten_src_ATen_native_sparse_ValidateCompressedIndicesCommon.h @@ -0,0 +1,78 @@ +--- aten/src/ATen/native/sparse/ValidateCompressedIndicesCommon.h.orig 2023-05-07 08:51:40 UTC ++++ aten/src/ATen/native/sparse/ValidateCompressedIndicesCommon.h +@@ -39,7 +39,7 @@ namespace { + // use `cidx/idx` to refer to `compressed_indices/plain_indices` respectively. + + INVARIANT_CHECK_FUNC_API +-_assert(const bool cond, const char* const message) { ++__assert(const bool cond, const char* const message) { + #ifdef GPUCC + CUDA_KERNEL_ASSERT(cond && message); + #else +@@ -57,9 +57,9 @@ INVARIANT_CHECK_FUNC_API _check_first_cidx_is_zero( + const index_t& zero) { + const bool invariant = cidx == zero; + if (cdim_name == CDimName::CRow) { +- _assert(invariant, "`crow_indices[..., 0] == 0` is not satisfied."); ++ __assert(invariant, "`crow_indices[..., 0] == 0` is not satisfied."); + } else { +- _assert(invariant, "`ccol_indices[..., 0] == 0` is not satisfied."); ++ __assert(invariant, "`ccol_indices[..., 0] == 0` is not satisfied."); + } + } + +@@ -71,9 +71,9 @@ INVARIANT_CHECK_FUNC_API _check_last_cidx_is_nnz( + const index_t& nnz) { + const bool invariant = cidx == nnz; + if (cdim_name == CDimName::CRow) { +- _assert(invariant, "`crow_indices[..., -1] == nnz` is not satisfied."); ++ __assert(invariant, "`crow_indices[..., -1] == nnz` is not satisfied."); + } else { +- _assert(invariant, "`ccol_indices[..., -1] == nnz` is not satisfied."); ++ __assert(invariant, "`ccol_indices[..., -1] == nnz` is not satisfied."); + } + } + +@@ -88,11 +88,11 @@ INVARIANT_CHECK_FUNC_API _check_cidx_nondecreasing_loc + const auto s_cidx = cidx_next - cidx; + const bool invariant = zero <= s_cidx && s_cidx <= dim; + if (cdim_name == CDimName::CRow) { +- _assert( ++ __assert( + invariant, + "`0 <= crow_indices[..., 1:] - crow_indices[..., :-1] <= ncols` is not satisfied."); + } else { +- _assert( ++ __assert( + invariant, + "`0 <= ccol_indices[..., 1:] - ccol_indices[..., :-1] <= nrows` is not satisfied."); + } +@@ -107,9 +107,9 @@ INVARIANT_CHECK_FUNC_API _check_idx_bounds( + const index_t& dim) { + const bool invariant = zero <= idx && idx < dim; + if (cdim_name == CDimName::CRow) { +- _assert(invariant, "`0 <= col_indices < ncols` is not satisfied."); ++ __assert(invariant, "`0 <= col_indices < ncols` is not satisfied."); + } else { +- _assert(invariant, "`0 <= row_indices < nrows` is not satisfied."); ++ __assert(invariant, "`0 <= row_indices < nrows` is not satisfied."); + } + } + +@@ -128,14 +128,14 @@ INVARIANT_CHECK_FUNC_API _check_idx_sorted_distinct_va + for (auto* RESTRICT curr = slice_begin + 1; curr < slice_end; ++curr) { + const auto invariant = *(curr - 1) < *curr; + if (cdim_name == CDimName::CRow) { +- _assert( ++ __assert( + invariant, + "`col_indices[..., crow_indices[..., i - 1]:crow_indices[..., i]] " + "for all i = 1, ..., nrows " + "are sorted and distinct along the last dimension values` " + "is not satisfied."); + } else { +- _assert( ++ __assert( + invariant, + "`row_indices[..., ccol_indices[..., i - 1]:ccol_indices[..., i]] " + "for all i = 1, ..., ncols " diff --git a/misc/py-pytorch/files/patch-cmake_Dependencies.cmake b/misc/py-pytorch/files/patch-cmake_Dependencies.cmake new file mode 100644 index 000000000000..165534d123bd --- /dev/null +++ b/misc/py-pytorch/files/patch-cmake_Dependencies.cmake @@ -0,0 +1,11 @@ +--- cmake/Dependencies.cmake.orig 2022-12-16 00:23:46 UTC ++++ cmake/Dependencies.cmake +@@ -339,7 +339,7 @@ if(USE_NNPACK OR USE_QNNPACK OR USE_PYTORCH_QNNPACK OR + set(DISABLE_NNPACK_AND_FAMILY ON) + endif() + else() +- if(NOT IOS AND NOT (CMAKE_SYSTEM_NAME MATCHES "^(Android|Linux|Darwin|Windows)$")) ++ if(NOT IOS AND NOT (CMAKE_SYSTEM_NAME MATCHES "^(Android|Linux|FreeBSD|Darwin|Windows)$")) + message(WARNING + "Target platform \"${CMAKE_SYSTEM_NAME}\" is not supported in {Q/X}NNPACK. " + "Supported platforms are Android, iOS, Linux, and macOS. " diff --git a/misc/py-pytorch/files/patch-cmake_public_mkldnn.cmake b/misc/py-pytorch/files/patch-cmake_public_mkldnn.cmake new file mode 100644 index 000000000000..77b3923f4e2b --- /dev/null +++ b/misc/py-pytorch/files/patch-cmake_public_mkldnn.cmake @@ -0,0 +1,11 @@ +--- cmake/public/mkldnn.cmake.orig 2022-12-16 00:23:46 UTC ++++ cmake/public/mkldnn.cmake +@@ -4,7 +4,7 @@ if(CPU_AARCH64) + include(${CMAKE_CURRENT_LIST_DIR}/ComputeLibrary.cmake) + endif() + +-find_package(MKLDNN QUIET) ++find_package(MKLDNN REQUIRED) + + if(NOT TARGET caffe2::mkldnn) + add_library(caffe2::mkldnn INTERFACE IMPORTED) diff --git a/misc/py-pytorch/files/patch-third__party_cpuinfo_CMakeLists.txt b/misc/py-pytorch/files/patch-third__party_cpuinfo_CMakeLists.txt new file mode 100644 index 000000000000..2b01f115b89e --- /dev/null +++ b/misc/py-pytorch/files/patch-third__party_cpuinfo_CMakeLists.txt @@ -0,0 +1,56 @@ +--- third_party/cpuinfo/CMakeLists.txt.orig 2023-04-03 19:46:00 UTC ++++ third_party/cpuinfo/CMakeLists.txt +@@ -65,7 +65,7 @@ IF(NOT CMAKE_SYSTEM_PROCESSOR) + "cpuinfo will compile, but cpuinfo_initialize() will always fail.") + SET(CPUINFO_SUPPORTED_PLATFORM FALSE) + ENDIF() +-ELSEIF(NOT CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?|armv[5-8].*|aarch64|arm64|ARM64)$") ++ELSEIF(NOT CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?|armv[5-8].*|aarch64|arm64|ARM64)$") + MESSAGE(WARNING + "Target processor architecture \"${CPUINFO_TARGET_PROCESSOR}\" is not supported in cpuinfo. " + "cpuinfo will compile, but cpuinfo_initialize() will always fail.") +@@ -77,7 +77,7 @@ IF(NOT CMAKE_SYSTEM_NAME) + "Target operating system is not specified. " + "cpuinfo will compile, but cpuinfo_initialize() will always fail.") + SET(CPUINFO_SUPPORTED_PLATFORM FALSE) +-ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS|Darwin|Linux|Android)$") ++ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS|Darwin|Linux|FreeBSD|Android)$") + IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14" AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS") + MESSAGE(WARNING + "Target operating system \"${CMAKE_SYSTEM_NAME}\" is not supported in cpuinfo. " +@@ -123,7 +123,7 @@ SET(CPUINFO_SRCS + src/cache.c) + + IF(CPUINFO_SUPPORTED_PLATFORM) +- IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND (CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$" OR IOS_ARCH MATCHES "^(i386|x86_64)$")) ++ IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND (CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?)$" OR IOS_ARCH MATCHES "^(i386|x86_64)$")) + LIST(APPEND CPUINFO_SRCS + src/x86/init.c + src/x86/info.c +@@ -324,7 +324,7 @@ ENDIF() + # ---[ cpuinfo mock library and mock tests + IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_MOCK_TESTS) + SET(CPUINFO_MOCK_SRCS "${CPUINFO_SRCS}") +- IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$") ++ IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?)$") + LIST(APPEND CPUINFO_MOCK_SRCS src/x86/mockcpuid.c) + ENDIF() + IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") +@@ -768,7 +768,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_T + ADD_TEST(NAME get-current-test COMMAND get-current-test) + ENDIF() + +- IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$") ++ IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?)$") + ADD_EXECUTABLE(brand-string-test test/name/brand-string.cc) + CPUINFO_TARGET_ENABLE_CXX11(brand-string-test) + CPUINFO_TARGET_RUNTIME_LIBRARY(brand-string-test) +@@ -835,7 +835,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_TOOLS) + CPUINFO_TARGET_RUNTIME_LIBRARY(cpuinfo-dump) + ENDIF() + +- IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$") ++ IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?)$") + ADD_EXECUTABLE(cpuid-dump tools/cpuid-dump.c) + CPUINFO_TARGET_ENABLE_C99(cpuid-dump) + CPUINFO_TARGET_RUNTIME_LIBRARY(cpuid-dump) diff --git a/misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp b/misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp new file mode 100644 index 000000000000..09a801db1dfc --- /dev/null +++ b/misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp @@ -0,0 +1,10 @@ +--- third_party/fbgemm/third_party/asmjit/src/asmjit/core/virtmem.cpp.orig 2022-12-16 00:23:48 UTC ++++ third_party/fbgemm/third_party/asmjit/src/asmjit/core/virtmem.cpp +@@ -45,6 +45,7 @@ + #endif + + #include ++#include + + #if defined(__APPLE__) || defined(__BIONIC__) + #define ASMJIT_VM_SHM_DETECT 0 diff --git a/misc/py-pytorch/files/patch-third__party_kineto_libkineto_src_ThreadUtil.cpp b/misc/py-pytorch/files/patch-third__party_kineto_libkineto_src_ThreadUtil.cpp new file mode 100644 index 000000000000..f014a26e4f20 --- /dev/null +++ b/misc/py-pytorch/files/patch-third__party_kineto_libkineto_src_ThreadUtil.cpp @@ -0,0 +1,11 @@ +--- third_party/kineto/libkineto/src/ThreadUtil.cpp.orig 2023-04-03 19:46:02 UTC ++++ third_party/kineto/libkineto/src/ThreadUtil.cpp +@@ -57,7 +57,7 @@ int32_t systemThreadId() { + #elif defined _MSC_VER + _sysTid = (int32_t)GetCurrentThreadId(); + #else +- _sysTid = (int32_t)syscall(SYS_gettid); ++ _sysTid = (int32_t)syscall(SYS_getpid); + #endif + } + return _sysTid; diff --git a/misc/py-pytorch/pkg-descr b/misc/py-pytorch/pkg-descr new file mode 100644 index 000000000000..6378f7a68ec8 --- /dev/null +++ b/misc/py-pytorch/pkg-descr @@ -0,0 +1,3 @@ +PyTorch is a Python package that provides two high-level features: +* Tensor computation (like NumPy) with strong GPU acceleration +* Deep neural networks built on a tape-based autograd system