From d2da1cd1673e97c3572d9cf814b3993420cf0bfe Mon Sep 17 00:00:00 2001 From: Sam Stites Date: Sun, 30 Sep 2018 10:54:21 -0500 Subject: [PATCH] manage cabal files, ignore profiling work --- .gitignore | 16 ++ examples/hasktorch-examples.cabal | 24 +-- .../{hasktorch-core.cabal => hasktorch.cabal} | 33 ++-- indef/hasktorch-indef-gpu.cabal | 144 ------------------ ...-indef-cpu.cabal => hasktorch-indef.cabal} | 0 lenet-cifar10-20k-train-report.log | 26 ---- zoo/hasktorch-zoo.cabal | 4 +- 7 files changed, 48 insertions(+), 199 deletions(-) rename hasktorch/{hasktorch-core.cabal => hasktorch.cabal} (99%) delete mode 100644 indef/hasktorch-indef-gpu.cabal rename indef/{hasktorch-indef-cpu.cabal => hasktorch-indef.cabal} (100%) delete mode 100644 lenet-cifar10-20k-train-report.log diff --git a/.gitignore b/.gitignore index 474a9ea56..16dbb1b4c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,21 @@ output/raw result result-* +# profiling files +*.log +*.ps +*.hp +*.svg +*.folded +*.prof +*.svg + +# old dependencies (moved to github.com/hasktorch/ffi) +vendor/ + +# files created by python examples +data/ + # Created by https://www.gitignore.io/api/c,vim,c++,linux,macos,emacs,haskell ### C ### @@ -241,3 +256,4 @@ tags # End of https://www.gitignore.io/api/c,vim,c++,linux,macos,emacs,haskell + diff --git a/examples/hasktorch-examples.cabal b/examples/hasktorch-examples.cabal index da1b69e64..eb57b532d 100644 --- a/examples/hasktorch-examples.cabal +++ b/examples/hasktorch-examples.cabal @@ -29,7 +29,7 @@ executable gradient-descent ghc-options: -Wall -fno-cse build-depends: base >=4.7 && <5 - , hasktorch-core + , hasktorch , microlens >=0.4.8.1 , dimensions , singletons @@ -44,7 +44,7 @@ executable multivariate-normal ghc-options: -Wall -fno-cse build-depends: base >=4.7 && <5 - , hasktorch-core + , hasktorch other-modules: Paths_hasktorch_examples default-language: Haskell2010 @@ -58,7 +58,7 @@ executable lasso ghc-options: -Wall -fno-cse build-depends: base >=4.7 && <5 - , hasktorch-core + , hasktorch , microlens other-modules: Paths_hasktorch_examples @@ -71,7 +71,7 @@ executable ad ghc-options: -Wall -fno-cse build-depends: base >=4.7 && <5 - , hasktorch-core + , hasktorch , singletons , dimensions other-modules: @@ -86,7 +86,7 @@ executable bayesian-regression ghc-options: -Wall -fno-cse build-depends: base >=4.7 && <5 - , hasktorch-core + , hasktorch other-modules: Paths_hasktorch_examples if flag(cuda) @@ -104,7 +104,7 @@ executable download-mnist , cryptonite , directory , filepath - , hasktorch-core + , hasktorch , network-uri other-modules: Paths_hasktorch_examples @@ -117,7 +117,7 @@ executable ff-typed ghc-options: -Wall -fno-cse build-depends: base >=4.7 && <5 - , hasktorch-core + , hasktorch , dimensions other-modules: Paths_hasktorch_examples @@ -130,7 +130,7 @@ executable ff-untyped ghc-options: -Wall -fno-cse build-depends: base >=4.7 && <5 - , hasktorch-core + , hasktorch , dimensions , singletons other-modules: @@ -144,7 +144,7 @@ executable static-tensor-usage ghc-options: -Wall -fno-cse build-depends: base >=4.7 && <5 - , hasktorch-core + , hasktorch other-modules: Paths_hasktorch_examples @@ -167,7 +167,7 @@ executable lenet-cifar10 build-depends: base >=4.7 && <5 , backprop - , hasktorch-core + , hasktorch , unordered-containers , dimensions , hasktorch-zoo @@ -208,7 +208,7 @@ executable lenet-cifar10-initialization , filepath , unordered-containers , ghc-typelits-natnormalise - , hasktorch-core + , hasktorch , hasktorch-zoo , dlist @@ -245,7 +245,7 @@ executable lenet-cifar10-trainfour , directory , filepath , ghc-typelits-natnormalise - , hasktorch-core + , hasktorch , hasktorch-zoo , dlist diff --git a/hasktorch/hasktorch-core.cabal b/hasktorch/hasktorch.cabal similarity index 99% rename from hasktorch/hasktorch-core.cabal rename to hasktorch/hasktorch.cabal index 628d0870a..256fdbc6b 100644 --- a/hasktorch/hasktorch-core.cabal +++ b/hasktorch/hasktorch.cabal @@ -1,5 +1,5 @@ cabal-version: 2.2 -name: hasktorch-core +name: hasktorch version: 0.1.0.0 synopsis: Torch for tensors and neural networks in Haskell description: core tensor abstractions wrapping raw TH bindings @@ -28,7 +28,7 @@ executable memcheck hs-source-dirs: exe build-depends: base >=4.7 && <5 - , hasktorch-core + , hasktorch test-suite spec type: exitcode-stdio-1.0 @@ -42,7 +42,8 @@ test-suite spec , base >=4.7 && <5 , dimensions , ghc-typelits-natnormalise - , hasktorch-core + , hasktorch + , hasktorch-types-th , hspec >=2.4.4 -- , hspec-discover , singletons >= 2.4.1 @@ -51,22 +52,24 @@ test-suite spec , mtl , microlens-platform , monad-loops + , managed , singletons , time , transformers other-modules: Orphans - , MemorySpec - , RawLapackSVDSpec - , GarbageCollectionSpec - , Torch.Prelude.Extras - , Torch.Core.LogAddSpec - , Torch.Core.RandomSpec + -- , MemorySpec + -- , RawLapackSVDSpec + -- , GarbageCollectionSpec + -- , Torch.Prelude.Extras + -- , Torch.Core.LogAddSpec + -- , Torch.Core.RandomSpec -- We can't move this to hasktorch-indef until backpack gets some updates: , Torch.Static.TensorSpec - , Torch.Static.NN.AbsSpec - , Torch.Static.NN.LinearSpec + , Torch.StorageSpec + -- , Torch.Static.NN.AbsSpec + -- , Torch.Static.NN.LinearSpec -- , Torch.Static.NN.Conv1dSpec -- , Torch.Static.NN.Conv2dSpec -- , Torch.Static.NN.ReLUSpec @@ -78,7 +81,7 @@ library hs-source-dirs: utils build-depends: base >=4.7 && <5 - , hasktorch-core-cpu + , hasktorch-cpu , hasktorch-types-th , containers @@ -149,7 +152,7 @@ library } if flag(cuda) { build-depends: - hasktorch-core-gpu + hasktorch-gpu reexported-modules: Torch.Cuda.Long @@ -188,7 +191,7 @@ library } -library hasktorch-core-cpu +library hasktorch-cpu hs-source-dirs: src, utils default-language: Haskell2010 default-extensions: LambdaCase, DataKinds, TypeFamilies, TypeSynonymInstances @@ -882,7 +885,7 @@ library hasktorch-core-cpu -library hasktorch-core-gpu +library hasktorch-gpu hs-source-dirs: src, utils default-language: Haskell2010 default-extensions: LambdaCase, DataKinds, TypeFamilies, TypeSynonymInstances diff --git a/indef/hasktorch-indef-gpu.cabal b/indef/hasktorch-indef-gpu.cabal deleted file mode 100644 index 67a14b5f3..000000000 --- a/indef/hasktorch-indef-gpu.cabal +++ /dev/null @@ -1,144 +0,0 @@ -name: hasktorch-indef-gpu -version: 0.0.1.0 -synopsis: Torch for tensors and neural networks in Haskell -description: core tensor abstractions wrapping raw TH bindings -category: Tensors, Machine Learning -homepage: https://github.com/hasktorch/hasktorch#readme -bug-reports: https://github.com/hasktorch/hasktorch/issues -author: Austin Huang -license: BSD3 -build-type: Simple -cabal-version: >= 2.0 - -source-repository head - type: git - location: https://github.com/hasktorch/hasktorch - -library - signatures: - Torch.Sig.Index.Tensor - , Torch.Sig.Index.TensorFree - , Torch.Sig.Mask.Tensor - , Torch.Sig.Mask.TensorFree - , Torch.Sig.Mask.MathReduce - hs-source-dirs: src - default-language: Haskell2010 - default-extensions: DataKinds, KindSignatures, TypeSynonymInstances - ghc-options: -Wno-deprecations - build-depends: - base >=4.7 && <5 - , backprop >= 0.2 && < 0.3 - , containers - , deepseq >=1.3.0.0 - , dimensions >= 1.0 - , hasktorch-signatures - , hasktorch-types-th - , hasktorch-raw-th - , managed >=1.0.0 && <1.1 - , microlens >=0.4.8.1 - , mtl - , numeric-limits - , safe-exceptions >=0.1.0.0 - , singletons >=2.2 - , ghc-typelits-natnormalise - , transformers >= 0.5 - , text >=1.2.2.2 - , typelits-witnesses >=0.2.3.0 - - , hasktorch-types-thc - , cuda - cpp-options: -DCUDA - - other-modules: - Torch.Indef.Internal - - exposed-modules: - -- FIXME: not sure where to go with commented-out classes, they are TH-only but there are some THC-only things as well - -- , Torch.Class.Blas - -- , Torch.Class.Lapack - -- , Torch.Class.Tensor.Conv - -- , Torch.Class.Vector - - Torch.Indef.Storage - , Torch.Indef.Storage.Copy - , Torch.Indef.Types - , Torch.Indef.Index - , Torch.Indef.Mask - - -- ==================================================== -- - -- Dynamic Tensor modules - -- ==================================================== -- - , Torch.Indef.Dynamic.Tensor - , Torch.Indef.Dynamic.Tensor.Copy - , Torch.Indef.Dynamic.Tensor.Index - , Torch.Indef.Dynamic.Tensor.Masked - , Torch.Indef.Dynamic.Tensor.Math - , Torch.Indef.Dynamic.Tensor.Math.Compare - , Torch.Indef.Dynamic.Tensor.Math.CompareT - , Torch.Indef.Dynamic.Tensor.Math.Pairwise - , Torch.Indef.Dynamic.Tensor.Math.Pointwise - , Torch.Indef.Dynamic.Tensor.Math.Reduce - , Torch.Indef.Dynamic.Tensor.Math.Random.TH - , Torch.Indef.Dynamic.Tensor.Math.Scan - , Torch.Indef.Dynamic.Tensor.Mode - , Torch.Indef.Dynamic.Tensor.Random.TH - , Torch.Indef.Dynamic.Tensor.Random.THC - , Torch.Indef.Dynamic.Tensor.ScatterGather - , Torch.Indef.Dynamic.Tensor.Sort - , Torch.Indef.Dynamic.Tensor.TopK - - , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Signed - - , Torch.Indef.Dynamic.NN - , Torch.Indef.Dynamic.NN.Activation - , Torch.Indef.Dynamic.NN.Criterion - , Torch.Indef.Dynamic.NN.Pooling - , Torch.Indef.Dynamic.Tensor.Math.Blas - , Torch.Indef.Dynamic.Tensor.Math.Floating - , Torch.Indef.Dynamic.Tensor.Math.Lapack - , Torch.Indef.Dynamic.Tensor.Math.Pointwise.Floating - , Torch.Indef.Dynamic.Tensor.Math.Reduce.Floating - - -- ==================================================== -- - -- Static Tensor modules - -- ==================================================== -- - , Torch.Indef.Static.Tensor - , Torch.Indef.Static.Tensor.Copy - , Torch.Indef.Static.Tensor.Index - , Torch.Indef.Static.Tensor.Masked - , Torch.Indef.Static.Tensor.Math - , Torch.Indef.Static.Tensor.Math.Compare - , Torch.Indef.Static.Tensor.Math.CompareT - , Torch.Indef.Static.Tensor.Math.Pairwise - , Torch.Indef.Static.Tensor.Math.Pointwise - , Torch.Indef.Static.Tensor.Math.Random.TH - , Torch.Indef.Static.Tensor.Math.Reduce - , Torch.Indef.Static.Tensor.Math.Scan - , Torch.Indef.Static.Tensor.Random.TH - , Torch.Indef.Static.Tensor.Random.THC - , Torch.Indef.Static.Tensor.Mode - , Torch.Indef.Static.Tensor.ScatterGather - , Torch.Indef.Static.Tensor.Sort - , Torch.Indef.Static.Tensor.TopK - - , Torch.Indef.Static.Tensor.Math.Pointwise.Signed - - , Torch.Indef.Static.NN - , Torch.Indef.Static.NN.Activation - , Torch.Indef.Static.NN.Backprop - , Torch.Indef.Static.NN.Conv1d - , Torch.Indef.Static.NN.Conv2d - -- , Torch.Indef.Static.NN.Conv3d - , Torch.Indef.Static.NN.Criterion - , Torch.Indef.Static.NN.Layers - , Torch.Indef.Static.NN.Linear - , Torch.Indef.Static.NN.Math - , Torch.Indef.Static.NN.Padding - , Torch.Indef.Static.NN.Pooling - , Torch.Indef.Static.NN.Sampling - , Torch.Indef.Static.Tensor.Math.Blas - , Torch.Indef.Static.Tensor.Math.Floating - , Torch.Indef.Static.Tensor.Math.Lapack - , Torch.Indef.Static.Tensor.Math.Pointwise.Floating - , Torch.Indef.Static.Tensor.Math.Reduce.Floating - diff --git a/indef/hasktorch-indef-cpu.cabal b/indef/hasktorch-indef.cabal similarity index 100% rename from indef/hasktorch-indef-cpu.cabal rename to indef/hasktorch-indef.cabal diff --git a/lenet-cifar10-20k-train-report.log b/lenet-cifar10-20k-train-report.log deleted file mode 100644 index 39420082e..000000000 --- a/lenet-cifar10-20k-train-report.log +++ /dev/null @@ -1,26 +0,0 @@ -Up to date -LeNet { - conv1 :: Conv2d (features: 3, output: 6, kernelWidth: 5, kernelHeight: 5) - conv2 :: Conv2d (features: 6, output: 16, kernelWidth: 5, kernelHeight: 5) - fc1 :: Linear (input: 400, output: 120) - fc2 :: Linear (input: 120, output: 84) - fc3 :: Linear (input: 84, output: 10) -} - -epochs start - -"epoch (1,3)" - -[Epoch 1/3](4b#500)[ce 2.3019] -[Epoch 1/3](4b#1000)[ce 2.3036] -[Epoch 1/3](4b#1500)[ce 2.3021] -[Epoch 1/3](4b#2000)[ce 2.3026] -[Epoch 1/3](4b#2500)[ce 2.3011] -[Epoch 1/3](4b#3000)[ce 2.2999] -[Epoch 1/3](4b#3500)[ce 2.2975] -[Epoch 1/3](4b#4000)[ce 2.2972] -[Epoch 1/3](4b#4500)[ce 2.2955] -[Epoch 1/3](4b#5000)[ce 2.2927] -"epoch (2,3)" - -[Epoch 2/3](4b#500)[ce 2.2901] \ No newline at end of file diff --git a/zoo/hasktorch-zoo.cabal b/zoo/hasktorch-zoo.cabal index e340c2323..0c9d0de0f 100644 --- a/zoo/hasktorch-zoo.cabal +++ b/zoo/hasktorch-zoo.cabal @@ -38,7 +38,7 @@ library , backprop , dimensions , hashable - , hasktorch-core + , hasktorch , microlens-platform , microlens-th , singletons @@ -92,7 +92,7 @@ benchmark bench build-depends: base , hasktorch-zoo - , hasktorch-core + , hasktorch , random-shuffle , transformers , list-t