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

floating point exception in RandBLAS::SJLTS::fill_colwise #18

Closed
burlen opened this issue Dec 9, 2022 · 5 comments
Closed

floating point exception in RandBLAS::SJLTS::fill_colwise #18

burlen opened this issue Dec 9, 2022 · 5 comments

Comments

@burlen
Copy link
Contributor

burlen commented Dec 9, 2022

There's a floating point exception generated by the following line because j == n_rows == 4

ell = j + randpair.v[0] % (n_rows - j);

we got here by:

(gdb) where
#0  0x00007fffbd9b0e1c in RandBLAS::sjlts::fill_colwise<double> (sjl=..., seed_key=15611466, seed_ctr=975143) at /work/rblas/RandLAPACK-install/include/RandBLAS/sjlts.hh:89
#1  0x00007fffbd989c09 in RandLAPACK::comps::preconditioners::rpc_svd_sjlt<double> (m=3, n=2, d=4, k=8, A_rm=0x555556114f50, M_wk=0x555556230ed0, mu=0, threads=1, seed_key=15611466, seed_ctr=975143)
    at /work/rblas/RandLAPACK-install/include/RandLAPACK/comps/preconditioners.hh:79
#2  0x00007fffbd96f101 in block_PCG_precond_lstsq<double> (A_cm=..., A_rm=..., ridge_coeff=0, B=..., X=..., m=3, n=2, s=1, layout=Layout::ColMajor, device=-1, strm=..., queue=0x0, cb_handle=0x0, cs_handle=0x0) at /work/rblas/gpu_linsolver/BPCG.h:247

the value of sjl at this point is:

(gdb) print sjl
$13 = (const RandBLAS::sjlts::SJLT<double> &) @0x7fffffffc890: {ori = RandBLAS::sjlts::ColumnWise, n_rows = 4, n_cols = 3, 
  vec_nnz = 8, rows = 0x5555569578c0, cols = 0x555556957980, vals = 0x555556f6d740}
@burlen
Copy link
Contributor Author

burlen commented Dec 9, 2022

@rileyjmurray Could you take a look at this?

@rileyjmurray
Copy link
Contributor

rileyjmurray commented Dec 9, 2022 via email

@rileyjmurray
Copy link
Contributor

The problem is that vec_nnz = 8 and n_rows = 4. We should raise an exception if vec_nnz > n_rows. (In practice this should never happen, since n_rows will be at least a few thousand and vec_nnz should rarely be more than 8.)

@burlen
Copy link
Contributor Author

burlen commented Dec 9, 2022

Got it thanks! May be worth mentioning this in the rpc_svd_sjlt Doxygen comments as well

@burlen
Copy link
Contributor Author

burlen commented Dec 19, 2022

user error

@burlen burlen closed this as completed Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants