PyTorch is an open-source machine learning library for Python, based on the
Torch library, used for applications such as natural language processing.
It is primarily developed by Facebook's AI Research lab.
PyTorch provides two high-level features:
* Tensor computation (like NumPy) with strong GPU acceleration
* Deep neural networks built on a tape-based autograd system
It is a popular choice for deep learning research and production due to its
flexibility and ease of use.
NOTE: If this package has multiple flavors (see below), then use one of them instead of the name specified above. NOTE: This is a Python port. Instead of py312-pytorch listed in the above command, you can pick from the names under the Packages section.
===> The following configuration options are available for py312-pytorch-2.14.1:
VULKAN=on: Vulkan GPU support
===> Use 'make config' to modify these settings
You installed PyTorch: an AI toolkit.
## Need env var on amd64 Zen5/Zen6 CPU architectures
Due to the bug in the OpenBLAS CPU arch detection PyTorch will
crash on Zen5/Zen6 CPU architectures.
Reference: https://github.com/OpenMathLib/OpenBLAS/issues/6029
Use the following environment variable to work around this problem:
OPENBLAS_CORETYPE=SKYLAKEX (some other values might work too)
The same problem exists in all software that uses OpenBLAS, not just PyTorch.
## Need env var on aarch64 due to high TLS requirements
When running PyTorch on aarch64 you will need to have this environment
variable set:
LD_STATIC_TLS_EXTRA=4096
It pre-allocates more TLS space when the Python process starts so that
the PyTorch shared libraries will have sufficient TLS space when they are
loaded dynamically.
*/*: Bump all devel/protobuf consumers
They must always be bumped after devel/protobuf because it include
following files whose filenames contain %%PORTVERSION%%. Consequently,
the shlib will always change when PORTVERSION is increased.
lib/libprotobuf-lite.so.%%PORTVERSION%%.0
lib/libprotobuf.so.%%PORTVERSION%%.0
lib/libprotoc.so.%%PORTVERSION%%.0
Approved by: portmgr (blanket; fixing consumers)
misc/py-pytorch: fix build with clang >= 19 and libc++ 21
In ports f07b5ade5369 misc/py-pytorch was forced onto llvm:max=15, with
the reason "fix build on 14". Remove this, and add a patch to make it
build with clang >= 19 and libc++ 21.
PR: 292664
Approved by: yuri (maintainer)
MFH: 2026Q1
python.mk: rename PYTHON_EXT_SUFFIX to PYTHON_TAG, document, etc
EXT_SUFFIX, according to PEP 3149, refers to the full tag and
extension for compiled extension module objects, eg .cpython-311.so,
.cpython-313t.so, etc. We do not use the correct semantic meaning,
and this usage becomes ambiguous and confusing when tags do not
match between bytecode and compiled extension module objects.
Rename our PYTHON_EXT_SUFFIX to PYTHON_TAG to align with PEP 3147's
specification of a magic tag, which consists of implementation name
and shorthand version only. This is meant for bytecode and other
files containing this tag in their filename that do not depend on
a specific Python ABI for the same version. Chase all existing
consumers.
(Only the first 15 lines of the commit message are shown above )
python: bump all USE_PYTHON=distutils consumers after RUN_DEPENDS removal
Any missed ports, feel free to bump.
Any ports that need setuptools at runtime can have the devel/py-setuptools
manually added back to RUN_DEPENDS, but understand that this practice
is deprecated; see CHANGES for details.
*/*: bump PORTREVISION after OpenBLAS upgrade
Remark: this souldn’t be necessary, because the version of the library is the
same, but due to many changes between these releases, it is safer this way.
PR: 284314
all: drop support for expired FreeBSD 14.0
Simplify expressions for FreeBSD 13.X
Reviewed by: many
Differential Revision: https://reviews.freebsd.org/D46601
misc/py-pytorch: adjust `devel/abseil' dependency after recent update
As of commit 6c2f347f45e4 libabsl_flags.so library is gone, switch to
the base library to unbreak the build (this also improves consistency
against other ports).
misc/py-pytorch: Fix the problem that the cpuinfo library didn't support FreeBSD
The symptoms included error messages and exceptions.
Now the bundled cpuinfo directory is replaced with the cpuinfo patched with
the pull request patch that fixes FreeBSD compatibility.
misc/py-pytorch: Fix run-time failure: error: use of undeclared identifier
'__assert_fail'
One particular GPU-related assert macro has to be patched to be a regular
assert.
The problem was reported to the upstream.