Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Internal error: "inconsistent valuation @ shared 'Exp' tree with stable name 54" #63

ghost opened this Issue · 1 comment

1 participant


When attempting to multiply a matrix by a vector on the left with the following code:

(*^) :: (Elt e,IsNum e) => Acc (Array DIM1 e) -> Acc (Array DIM2 e) -> Acc (Array DIM1 e)
(*^) v m = generate (index1 b)
        (\ ix -> let (Z:.cols) = unlift ix :: (Z:.Exp Int)
                  in the $ (.^) v
                   $ takeCol cols m )
    where (Z:.a:.b) = unlift $ shape m :: (Z:.Exp Int:.Exp Int)

(.^) :: (Elt e,IsNum e) => Acc (Array DIM1 e) -> Acc (Array DIM1 e) -> Acc (Scalar e)
(.^) u v = fold1 (+) (zipWith (*) u v)

takeCol :: Elt e => Exp Int -> Acc (Array DIM2 e) -> Acc (Array DIM1 e)
takeCol n xs = let (Z:.rows:.cols) = (unlift $ shape xs :: (Z:.Exp Int:.Exp Int))
                in flatten $ backpermute
                 ( index2 (1::Exp Int) cols)
                 ( \ix -> let (Z:.j:.i) = unlift ix :: (Z:.Exp Int:.Exp Int)
                           in index2 n i )

and the following input:

run $ (use v) *^ (use m)

(where (v :: Array (Z:.5) Float) & (m :: Array (Z:.5:.3) Float)),

I get the following error in GHCi:

*** Exception:
*** Internal error in package accelerate ***
*** Please submit a bug report at
./Data/Array/Accelerate/Smart.hs:561 (convertSharingExp): inconsistent valuation @ shared 'Exp' tree with stable name 54;
env = [56]


This looks to be encoding nested parallelism, as takeCols depends on the index given to it by generate. The error message could probably be better, however; it warns about nested parallelism in other cases.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.