From nobody Wed Mar 15 10:18:44 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pc5vm5KY5z3yL1m; Wed, 15 Mar 2023 10:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pc5vm4s9nz43BX; Wed, 15 Mar 2023 10:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678875524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uoe1YGw56ypqZIeWRzgqt3JOEA3DHAUpv4Kz4fifEq0=; b=B4zVrqtxH8Cz03Od6NpGK8gGnmlUg4mJIXfA2nwD0zAo0fOkFAwAotE1Qjv+Z4+m3pbVwT LxgNx5ff+KQTwmBCfGx4mxmrtF2jG5+d4ixTIf6j4v7iYrruO1u6+kFrg5NK1Yn3KRSp7A /X3MybmqLu1Kwrl/rDsja9oGjzxhL8RzbGEzasmbkBV+Sexv8M5SdMZJ7dlO+axgfckQXo Gn2Ys17lo1w6lgUZ2LOtsU5guRhyAhtVy3ijJ60FRApQJkNKDhHR6D8LqN60Ep1jASUkLz BL5YMXhVZDXH0lk+LkM996gWKW8vIUo5C2gXwRqyJh2RD1ajk6oi8leHS/Y2Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678875524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uoe1YGw56ypqZIeWRzgqt3JOEA3DHAUpv4Kz4fifEq0=; b=vDfhhtCScb2Ry37GBuSlC63fyvWrr7SXD5kXBRU6irX+hxVigZ37d6TytYzQrhvrgd0HVx kXBAhnc0yKFS1pBqsMPGj2JUY7yIylC19GF0oINTM3eEgavCw+Qhh0xNSTsS6mtqhcSXV9 odGIAcvjUq60t1tSUALCicFnJ3t7Tb0zLs5JguFVrNffd9xa1ZX2qGsYCCJ3oAfiilbA0p RTL5YdzUigO0ifH+w0csfytDfhS3nS+OMMC5N5cyARN6Nh/MxSkc3fIJWi9a8NbxIGP9FY /CNKES1DRQUQwKb4UA/J8RBZh7tmYyQF9ddKC+L0y2/8WysbR02mDu3fxQ5dlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678875524; a=rsa-sha256; cv=none; b=V/KyGKCsQT02ldqkyL9THx+K+gZ/PPjOkT5unkUmIx4nqvUvF6vD2dY7rCMGDOW8it/f7y WmkCb0SUc1bKsEbS5OpzaneOBavRqFcTWwnbbg9NXPz6oXoGk3FT+cBE2zwopRVUZq1Tmt UW5V3mxzK76PLipUn5A+LEkt9D+qQvPvmFlcffpNpYPfj9D7c7XAvfYj10zHp0DurhO9Ey RwQfYrpg0pMwnf9jL4YxeD43fUmv38Lt/BnWALLSRr0GkagNTby12JNizmoy6EZVnZhTtC 7Q4uDq0Ndrta3T8ZOX+U/Hg2Y81kVzjrTxKZLDFkuCzB8KQJByDkocne4UyZJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pc5vm3qXrz1CLv; Wed, 15 Mar 2023 10:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FAIii6018539; Wed, 15 Mar 2023 10:18:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FAIiXJ018538; Wed, 15 Mar 2023 10:18:44 GMT (envelope-from git) Date: Wed, 15 Mar 2023 10:18:44 GMT Message-Id: <202303151018.32FAIiXJ018538@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: c15247cb4f64 - main - misc/flashlight: New port: Standalone C++ library for machine learning List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c15247cb4f6446b22b6c122dffba9f598c8f1b90 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=c15247cb4f6446b22b6c122dffba9f598c8f1b90 commit c15247cb4f6446b22b6c122dffba9f598c8f1b90 Author: Yuri Victorovich AuthorDate: 2023-03-15 10:17:16 +0000 Commit: Yuri Victorovich CommitDate: 2023-03-15 10:18:40 +0000 misc/flashlight: New port: Standalone C++ library for machine learning --- misc/Makefile | 1 + misc/flashlight/Makefile | 31 +++++ misc/flashlight/distinfo | 3 + ...patch-flashlight_fl_dataset_FileBlobDataset.cpp | 22 ++++ misc/flashlight/pkg-descr | 11 ++ misc/flashlight/pkg-plist | 132 +++++++++++++++++++++ 6 files changed, 200 insertions(+) diff --git a/misc/Makefile b/misc/Makefile index abb7ac05afd9..21d1f1cc12cd 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -107,6 +107,7 @@ SUBDIR += findutils SUBDIR += firestring SUBDIR += flag + SUBDIR += flashlight SUBDIR += fortune-mod-bible SUBDIR += fortune-mod-bofh SUBDIR += fortune-mod-epictetus diff --git a/misc/flashlight/Makefile b/misc/flashlight/Makefile new file mode 100644 index 000000000000..307c867c7b0e --- /dev/null +++ b/misc/flashlight/Makefile @@ -0,0 +1,31 @@ +PORTNAME= flashlight +DISTVERSIONPREFIX= v +DISTVERSION= 0.4.0-16 +DISTVERSIONSUFFIX= -gafcd364e +CATEGORIES= misc # machine-learning + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Standalone C++ library for machine learning +WWW= https://github.com/flashlight/flashlight + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= cereal>0:devel/cereal +LIB_DEPENDS= libdnnl.so:math/onednn252 + +USES= cmake:testing compiler:c++17-lang localbase pkgconfig +USE_GITHUB= yes +USE_LDCONFIG= yes + +CMAKE_OFF= FL_USE_ARRAYFIRE \ + FL_BUILD_TESTS FL_BUILD_EXAMPLES +CMAKE_OFF+= FL_BUILD_DISTRIBUTED # need to add MPI options +CMAKE_ON= BUILD_SHARED_LIBS \ + FL_USE_CPU +CMAKE_ON+= FL_USE_ONEDNN # needs to have oneDNN enabled because it needs a working tensor backend + +post-patch: # workaround for https://github.com/flashlight/flashlight/issues/1086 + @${RM} ${WRKSRC}/cmake/Findcereal.cmake + +.include diff --git a/misc/flashlight/distinfo b/misc/flashlight/distinfo new file mode 100644 index 000000000000..07eb73bba565 --- /dev/null +++ b/misc/flashlight/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1678872027 +SHA256 (flashlight-flashlight-v0.4.0-16-gafcd364e_GH0.tar.gz) = fef0eaf57a1ac58255be5d428265cb829b976ca5580215ba81406cb8808a743b +SIZE (flashlight-flashlight-v0.4.0-16-gafcd364e_GH0.tar.gz) = 1966617 diff --git a/misc/flashlight/files/patch-flashlight_fl_dataset_FileBlobDataset.cpp b/misc/flashlight/files/patch-flashlight_fl_dataset_FileBlobDataset.cpp new file mode 100644 index 000000000000..d3fabb44d987 --- /dev/null +++ b/misc/flashlight/files/patch-flashlight_fl_dataset_FileBlobDataset.cpp @@ -0,0 +1,22 @@ +- workaround for https://github.com/flashlight/flashlight/issues/1087 + +--- flashlight/fl/dataset/FileBlobDataset.cpp.orig 2023-03-15 07:10:45 UTC ++++ flashlight/fl/dataset/FileBlobDataset.cpp +@@ -72,7 +72,7 @@ int64_t FileBlobDataset::writeData( + auto fs = getStream(); + fs->seekp(offset, std::ios_base::beg); + fs->write(data, size); +- return fs->tellp() - offset; ++ return int64_t(fs->tellp()) - offset; + } + + int64_t FileBlobDataset::readData(int64_t offset, char* data, int64_t size) +@@ -80,7 +80,7 @@ int64_t FileBlobDataset::readData(int64_t offset, char + auto fs = getStream(); + fs->seekg(offset, std::ios_base::beg); + fs->read(data, size); +- return fs->tellg() - offset; ++ return int64_t(fs->tellg()) - offset; + } + + void FileBlobDataset::flushData() { diff --git a/misc/flashlight/pkg-descr b/misc/flashlight/pkg-descr new file mode 100644 index 000000000000..f7430a539c3d --- /dev/null +++ b/misc/flashlight/pkg-descr @@ -0,0 +1,11 @@ +Flashlight is a fast, flexible machine learning library written entirely in C++ +from the Facebook AI Research and the creators of Torch, TensorFlow, Eigen and +Deep Speech. + +Its core features include: +* Total internal modifiability including internal APIs for tensor computation. +* A small footprint, with the core clocking in at under 10 MB and 20k lines + of C++. +* High-performance defaults featuring just-in-time kernel compilation with + modern C++ via the ArrayFire tensor library. +* An emphasis on efficiency and scale. diff --git a/misc/flashlight/pkg-plist b/misc/flashlight/pkg-plist new file mode 100644 index 000000000000..467534659cae --- /dev/null +++ b/misc/flashlight/pkg-plist @@ -0,0 +1,132 @@ +include/flashlight/fl/autograd/Functions.h +include/flashlight/fl/autograd/Utils.h +include/flashlight/fl/autograd/Variable.h +include/flashlight/fl/autograd/autograd.h +include/flashlight/fl/autograd/tensor/AutogradExtension.h +include/flashlight/fl/autograd/tensor/AutogradExtensionBackends.h +include/flashlight/fl/autograd/tensor/AutogradOps.h +include/flashlight/fl/common/Defines.h +include/flashlight/fl/common/DevicePtr.h +include/flashlight/fl/common/DynamicBenchmark.h +include/flashlight/fl/common/Filesystem.h +include/flashlight/fl/common/Histogram.h +include/flashlight/fl/common/Logging.h +include/flashlight/fl/common/Plugin.h +include/flashlight/fl/common/Serialization-inl.h +include/flashlight/fl/common/Serialization.h +include/flashlight/fl/common/Timer.h +include/flashlight/fl/common/Types.h +include/flashlight/fl/common/Utils.h +include/flashlight/fl/common/common.h +include/flashlight/fl/common/threadpool/ThreadPool.h +include/flashlight/fl/contrib/contrib.h +include/flashlight/fl/contrib/modules/AdaptiveEmbedding.h +include/flashlight/fl/contrib/modules/AsymmetricConv1D.h +include/flashlight/fl/contrib/modules/Conformer.h +include/flashlight/fl/contrib/modules/PositionEmbedding.h +include/flashlight/fl/contrib/modules/RawWavSpecAugment.h +include/flashlight/fl/contrib/modules/Residual.h +include/flashlight/fl/contrib/modules/SinusoidalPositionEmbedding.h +include/flashlight/fl/contrib/modules/SpecAugment.h +include/flashlight/fl/contrib/modules/TDSBlock.h +include/flashlight/fl/contrib/modules/Transformer.h +include/flashlight/fl/contrib/modules/modules.h +include/flashlight/fl/dataset/BatchDataset.h +include/flashlight/fl/dataset/BlobDataset.h +include/flashlight/fl/dataset/ConcatDataset.h +include/flashlight/fl/dataset/Dataset.h +include/flashlight/fl/dataset/DatasetIterator.h +include/flashlight/fl/dataset/FileBlobDataset.h +include/flashlight/fl/dataset/MemoryBlobDataset.h +include/flashlight/fl/dataset/MergeDataset.h +include/flashlight/fl/dataset/PrefetchDataset.h +include/flashlight/fl/dataset/ResampleDataset.h +include/flashlight/fl/dataset/ShuffleDataset.h +include/flashlight/fl/dataset/TensorDataset.h +include/flashlight/fl/dataset/TransformDataset.h +include/flashlight/fl/dataset/Utils.h +include/flashlight/fl/dataset/datasets.h +include/flashlight/fl/distributed/DistributedApi.h +include/flashlight/fl/distributed/FileStore.h +include/flashlight/fl/distributed/LRUCache.h +include/flashlight/fl/distributed/distributed.h +include/flashlight/fl/distributed/reducers/CoalescingReducer.h +include/flashlight/fl/distributed/reducers/InlineReducer.h +include/flashlight/fl/distributed/reducers/Reducer.h +include/flashlight/fl/distributed/reducers/reducers.h +include/flashlight/fl/flashlight.h +include/flashlight/fl/meter/AverageValueMeter.h +include/flashlight/fl/meter/CountMeter.h +include/flashlight/fl/meter/EditDistanceMeter.h +include/flashlight/fl/meter/FrameErrorMeter.h +include/flashlight/fl/meter/MSEMeter.h +include/flashlight/fl/meter/TimeMeter.h +include/flashlight/fl/meter/TopKMeter.h +include/flashlight/fl/meter/meters.h +include/flashlight/fl/nn/DistributedUtils.h +include/flashlight/fl/nn/Init.h +include/flashlight/fl/nn/Utils.h +include/flashlight/fl/nn/modules/Activations.h +include/flashlight/fl/nn/modules/AdaptiveSoftMax.h +include/flashlight/fl/nn/modules/BatchNorm.h +include/flashlight/fl/nn/modules/Container.h +include/flashlight/fl/nn/modules/Conv2D.h +include/flashlight/fl/nn/modules/Dropout.h +include/flashlight/fl/nn/modules/Embedding.h +include/flashlight/fl/nn/modules/Identity.h +include/flashlight/fl/nn/modules/LayerNorm.h +include/flashlight/fl/nn/modules/Linear.h +include/flashlight/fl/nn/modules/Loss.h +include/flashlight/fl/nn/modules/Module.h +include/flashlight/fl/nn/modules/Normalize.h +include/flashlight/fl/nn/modules/Padding.h +include/flashlight/fl/nn/modules/Pool2D.h +include/flashlight/fl/nn/modules/PrecisionCast.h +include/flashlight/fl/nn/modules/RNN.h +include/flashlight/fl/nn/modules/Reorder.h +include/flashlight/fl/nn/modules/Transform.h +include/flashlight/fl/nn/modules/View.h +include/flashlight/fl/nn/modules/WeightNorm.h +include/flashlight/fl/nn/modules/modules.h +include/flashlight/fl/nn/nn.h +include/flashlight/fl/optim/AMSgradOptimizer.h +include/flashlight/fl/optim/AdadeltaOptimizer.h +include/flashlight/fl/optim/AdagradOptimizer.h +include/flashlight/fl/optim/AdamOptimizer.h +include/flashlight/fl/optim/NAGOptimizer.h +include/flashlight/fl/optim/NovogradOptimizer.h +include/flashlight/fl/optim/Optimizers.h +include/flashlight/fl/optim/RMSPropOptimizer.h +include/flashlight/fl/optim/SGDOptimizer.h +include/flashlight/fl/optim/Utils.h +include/flashlight/fl/optim/optim.h +include/flashlight/fl/runtime/CUDADevice.h +include/flashlight/fl/runtime/CUDAStream.h +include/flashlight/fl/runtime/CUDAUtils.h +include/flashlight/fl/runtime/Device.h +include/flashlight/fl/runtime/DeviceManager.h +include/flashlight/fl/runtime/DeviceType.h +include/flashlight/fl/runtime/Stream.h +include/flashlight/fl/runtime/SynchronousStream.h +include/flashlight/fl/runtime/runtime.h +include/flashlight/fl/tensor/Compute.h +include/flashlight/fl/tensor/DefaultTensorType.h +include/flashlight/fl/tensor/Index.h +include/flashlight/fl/tensor/Init.h +include/flashlight/fl/tensor/Profile.h +include/flashlight/fl/tensor/Random.h +include/flashlight/fl/tensor/Shape.h +include/flashlight/fl/tensor/TensorAdapter.h +include/flashlight/fl/tensor/TensorBackend.h +include/flashlight/fl/tensor/TensorBase.h +include/flashlight/fl/tensor/TensorExtension.h +include/flashlight/fl/tensor/Types.h +include/flashlight/fl/tensor/tensor.h +lib/libflashlight.so +lib/libflashlight.so.0 +lib/libflashlight.so.0.4.0 +%%DATADIR%%/cmake/FindFilesystem.cmake +%%DATADIR%%/cmake/flashlightConfig.cmake +%%DATADIR%%/cmake/flashlightConfigVersion.cmake +%%DATADIR%%/cmake/flashlightTargets-%%CMAKE_BUILD_TYPE%%.cmake +%%DATADIR%%/cmake/flashlightTargets.cmake