Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with matrix multiplication dimentions #197

Closed
Eliyaan opened this issue Feb 2, 2024 · 1 comment
Closed

Problem with matrix multiplication dimentions #197

Eliyaan opened this issue Feb 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Eliyaan
Copy link
Contributor

Eliyaan commented Feb 2, 2024

Describe the bug

As discussed here with spytheman : https://discord.com/channels/592103645835821068/763496422166626336/1202923962326323220

When using large matrices (that are not handled by simple loops but by dgemv) it outputs matrix dimention errors. (but maybe I just didn't understand something)

Expected Behavior

The matrix multiplications to work.

Current Behavior

[/home/nopana/NeuralNetworks-V-Module/examples/tst.v:8] 'works': works
[/home/nopana/NeuralNetworks-V-Module/examples/tst.v:12] 'works': works
================ V panic ================
   module: vsl.vlas.internal.blas
 function: dgemv()
  message: blas: bad leading dimension of A
     file: /home/nopana/.vmodules/vsl/vlas/internal/blas/dgemv.v:18
   v hash: 0a612bf
=========================================

Reproduction Steps

import vsl.la 

fn main() {
    // works 
    ma_small := la.Matrix.new[f64](3, 2)
    vec_small := []f64{len:2, init:1.0}
    _ := la.matrix_vector_mul(1.0, ma_small, vec_small)
    dump("works")
    ma_tr_small := la.Matrix.new[f64](1, 2)
    vec_tr_small := []f64{len:1, init:1.0}
    _ := la.matrix_tr_vector_mul(1.0, ma_tr_small, vec_tr_small)
    dump("works")

    // does not
    ma_big := la.Matrix.new[f64](30, 70)
    vec_big := []f64{len:70, init:1.0}
    _ := la.matrix_vector_mul(1.0, ma_big, vec_big)
    dump("works")
    ma_tr_big := la.Matrix.new[f64](10, 20)
    vec_tr_big := []f64{len:10, init:1.0}
    _ := la.matrix_tr_vector_mul(1.0, ma_tr_big, vec_tr_big)
    dump("works")
}

Possible Solution

The checks that dgemv may be wrong (a month ago I did modify them on a separate version and then the matmult did work fine).

Additional Information/Context

No response

V version

V 0.4.4 07016fb

Version used

last vsl commit

Environment details (OS name and version, etc.)

V full version: V 0.4.4 673a2f4.07016fb
OS: linux, Linux version 6.6.13-200.fc39.x86_64 (mockbuild@72f11b2996ed4699b0f705186172808f) (gcc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6), GNU ld version 2.40-13.fc39) #1 SMP PREEMPT_DYNAMIC Sat Jan 20 18:03:28 UTC 2024
Processor: 4 cpus, 64bit, little endian, Intel(R) Pentium(R) Gold 7505 @ 2.00GHz

getwd: /home/nopana/NeuralNetworks-V-Module
vexe: /home/nopana/v/v
vexe mtime: 2024-02-02 15:38:32

vroot: OK, value: /home/nopana/v
VMODULES: OK, value: /home/nopana/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.43.0
Git vroot status: weekly.2024.05-15-g07016fb3
.git/config present: true

CC version: cc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6)
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3

@Eliyaan Eliyaan added the bug Something isn't working label Feb 2, 2024
@Eliyaan Eliyaan changed the title Problem with matrix multiplicatoin dimentions Problem with matrix multiplication dimentions Feb 2, 2024
ulises-jeremias added a commit that referenced this issue Feb 4, 2024
@ulises-jeremias
Copy link
Member

Solved on master

ulises-jeremias added a commit that referenced this issue Feb 4, 2024
* 'main' of github.com:vlang/vsl:
  Finished #197
  update include and lib paths for openmpi on FreeBSD (#196)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants