Commit 0536d1ff authored by Alfredo Di Napoli's avatar Alfredo Di Napoli Committed by Alfredo Di Napoli

Drop accelerate-llvm dependency

This also changes the cabal.project to not pull the accelerate-llvm or
the llvm-hs dependencies.
parent 286fc44d
......@@ -18,8 +18,8 @@ fi
# with the `sha256sum` result calculated on the `cabal.project` and
# `cabal.project.freeze`. This ensures the files stay deterministic so that CI
# cache can kick in.
expected_cabal_project_hash="ac293a4c66092996bc85fbf14ef34b7cce3ed5b0612ceb9e1a5f395059631e0b"
expected_cabal_project_freeze_hash="32310c4d4e7b4679dcb90dcfcd0d6d1b175dbf885a77ffddca16d422998a521c"
expected_cabal_project_hash="ecf81ae67d3b7adbaf579187cc06592ed2cb0db625d16f69de8f16fa1bd3a2a1"
expected_cabal_project_freeze_hash="50f40d4fc0190b8e8645e2de3c3d40ddb3664339e7995f52f883d925685a9a49"
cabal --store-dir=$STORE_DIR v2-build --dry-run
......
......@@ -5,6 +5,7 @@ index-state: 2024-09-12T03:02:26Z
with-compiler: ghc-9.4.8
optimization: 2
benchmarks: False
packages:
./
......@@ -14,13 +15,6 @@ source-repository-package
location: https://github.com/AccelerateHS/accelerate.git
tag: 334d05519436bb7f20f9926ec76418f5b8afa359
source-repository-package
type: git
location: https://github.com/AccelerateHS/accelerate-llvm.git
tag: 2b5d69448557e89002c0179ea1aaf59bb757a6e3
subdir: accelerate-llvm-native/
accelerate-llvm/
-- Patch for "Allow NOT to backtrack"
source-repository-package
type: git
......@@ -32,13 +26,6 @@ source-repository-package
location: https://gitlab.iscpif.fr/gargantext/opaleye-textsearch.git
tag: 04b5c9044fef44393b66bffa258ca0b0f59c1087
source-repository-package
type: git
location: https://github.com/adinapoli/llvm-hs.git
tag: 7533a9ccd3bfe77141745f6b61039a26aaf5c83b
subdir: llvm-hs
llvm-hs-pure
source-repository-package
type: git
location: https://github.com/alpmestan/accelerate-arithmetic.git
......
......@@ -26,8 +26,6 @@ constraints: any.Boolean ==0.2.4,
any.accelerate ==1.3.0.0,
accelerate +bounds-checks -debug -internal-checks -nofib -unsafe-checks,
any.accelerate-arithmetic ==1.0.0.1,
any.accelerate-llvm ==1.3.0.0,
any.accelerate-llvm-native ==1.3.0.0,
any.accelerate-utility ==1.0.0.1,
any.adjunctions ==4.4.2,
any.aeson ==2.1.2.1,
......@@ -308,9 +306,6 @@ constraints: any.Boolean ==0.2.4,
any.linear ==1.23,
linear -herbie +template-haskell,
any.list-t ==1.0.5.7,
any.llvm-hs ==12.0.0,
llvm-hs -debug -llvm-with-rtti +shared-llvm,
any.llvm-hs-pure ==12.0.0,
any.lockfree-queue ==0.2.4,
any.logict ==0.8.1.0,
any.loop ==0.3.0,
......
......@@ -100,6 +100,10 @@ flag no-phylo-debug-logs
default: False
manual: True
flag enable-benchmarks
default: False
manual: True
library
import:
defaults
......@@ -493,7 +497,6 @@ library
, MonadRandom ^>= 0.6
, QuickCheck ^>= 2.14.2
, accelerate ^>= 1.3.0.0
, accelerate-llvm-native ^>= 1.3.0.0
, aeson ^>= 2.1.2.1
, ansi-terminal
, array ^>= 0.5.4.0
......@@ -712,7 +715,6 @@ common testDependencies
base >=4.7 && <5
, QuickCheck ^>= 2.14.2
, accelerate >= 1.3.0.0
, accelerate-llvm-native
, aeson ^>= 2.1.2.1
, aeson-qq
, async ^>= 2.2.4
......
......@@ -20,10 +20,11 @@ import Data.Swagger
import Data.Text (Text)
import GHC.Generics (Generic)
import Gargantext.Core.Methods.Similarities.Accelerate.Conditional (measureConditional')
import Gargantext.Core.Methods.Similarities.Accelerate.Distributional (logDistributional2)
import Gargantext.Core.LinearAlgebra.Operations (accelerate2MassivMatrix, massiv2AccelerateMatrix)
import Gargantext.Core.LinearAlgebra.Distributional (logDistributional2)
-- import Gargantext.Core.Text.Metrics.Count (coocOn)
-- import Gargantext.Core.Viz.Graph.Index
import Gargantext.Prelude (Ord, Eq, Int, Double, Show, map)
import Gargantext.Prelude (Ord, Eq, Int, Double, Show, map, ($), (.))
import Prelude (Enum, Bounded, minBound, maxBound)
import Test.QuickCheck (elements)
import Test.QuickCheck.Arbitrary
......@@ -36,7 +37,7 @@ data Similarity = Conditional | Distributional
measure :: Similarity -> Matrix Int -> Matrix Double
measure Conditional x = measureConditional' x
measure Distributional x = logDistributional2 x
measure Distributional x = massiv2AccelerateMatrix . logDistributional2 . accelerate2MassivMatrix $ x
------------------------------------------------------------------------
withMetric :: GraphMetric -> Similarity
......
......@@ -103,8 +103,7 @@ module Gargantext.Core.Methods.Similarities.Accelerate.Distributional
-- import qualified Data.Foldable as P (foldl1)
-- import Debug.Trace (trace)
import Data.Array.Accelerate as A
-- import Data.Array.Accelerate.Interpreter (run)
import Data.Array.Accelerate.LLVM.Native qualified as LLVM -- TODO: try runQ?
import Data.Array.Accelerate.Interpreter qualified as Naive
import Gargantext.Core.Methods.Matrix.Accelerate.Utils
import qualified Prelude
......@@ -146,7 +145,7 @@ import qualified Prelude
-- /IMPORTANT/: As this function computes the diagonal matrix in order to carry on the computation
-- the input has to be a square matrix, or this function will fail at runtime.
distributional :: Matrix Int -> Matrix Double
distributional = distributionalWith LLVM.run
distributional = distributionalWith Naive.run
distributionalWith :: (Elt e, FromIntegral Int e, Eq e, Prelude.Fractional (Exp e), Ord e)
=> (forall a. Arrays a => Acc a -> a)
......@@ -183,7 +182,7 @@ distributionalWith interpret m' = interpret $ result
result = termDivNan z_1 z_2
logDistributional2 :: Matrix Int -> Matrix Double
logDistributional2 m = logDistributional2With LLVM.run m
logDistributional2 m = logDistributional2With Naive.run m
logDistributional2With :: ( Elt e
, Prelude.Num (Exp e)
......
......@@ -67,6 +67,7 @@
- "linear-1.23"
- "logict-0.8.1.0"
- "lzma-0.0.1.1"
- "massiv-test-1.1.0.0"
- "math-functions-0.3.4.4"
- "megaparsec-9.6.1"
- "microlens-th-0.4.3.15"
......@@ -440,6 +441,7 @@ flags:
formatting:
"no-double-conversion": false
gargantext:
"enable-benchmarks": false
"no-phylo-debug-logs": true
"test-crypto": false
graphviz:
......@@ -509,6 +511,8 @@ flags:
"shared-llvm": true
lzma:
pkgconfig: true
massiv:
"unsafe-checks": false
"math-functions":
"system-erf": true
"system-expm1": true
......@@ -557,6 +561,9 @@ flags:
prettyprinter:
buildreadme: false
text: true
"quickcheck-classes-base":
"binary-laws": true
"unary-laws": true
"quickcheck-instances":
"bytestring-builder": false
reflection:
......
......@@ -124,8 +124,6 @@ testMatrix_04 = SquareMatrix $ fromList (Z :. 8 :. 8) $
-- Main test runner
--
-- | Needed as the LLVM and Naive backend generates some double with a long exponent which
-- won't compare verbatim.
tests :: TestTree
tests = testGroup "LinearAlgebra" [
testProperty "createIndices roundtrip" (compareImplementations (LA.createIndices @Int @Int) Legacy.createIndices mapCreateIndices)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment