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

TensorOperations.jl does not seem to support 32-bit Julia? #123

Open
frankwswang opened this issue Sep 14, 2022 · 7 comments
Open

TensorOperations.jl does not seem to support 32-bit Julia? #123

frankwswang opened this issue Sep 14, 2022 · 7 comments

Comments

@frankwswang
Copy link

I tried to install the package on a 32-bit Julia and got the precompile error message:

ERROR: LoadError: InexactError: trunc(Int32, 17001435136)
Stacktrace:
 [1] throw_inexacterror(f::Symbol, #unused#::Type{Int32}, val::UInt64)
   @ Core .\boot.jl:614
 [2] checked_trunc_sint
   @ .\boot.jl:636 [inlined]
 [3] toInt32
   @ .\boot.jl:678 [inlined]
 [4] Int32
   @ .\boot.jl:763 [inlined]
 [5] default_cache_size()
   @ TensorOperations PathToPackage\TensorOperations\LDxfx\src\TensorOperations.jl:81
 [6] top-level scope
   @ PathToJuliaEnv\.julia\packages\TensorOperations\LDxfx\src\TensorOperations.jl:91
 [7] include
   @ .\Base.jl:419 [inlined]
 [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
   @ Base .\loading.jl:1554
 [9] top-level scope
   @ stdin:1
@Jutho
Copy link
Owner

Jutho commented Sep 14, 2022

Can I infer correctly that you have 64 GB of memory on your machine? But you still use a 32-bit version of Julia. How does that work exactly?

@frankwswang
Copy link
Author

I only have 16 GB of memory on my machine. My system is a 64-bit Windows, but I wanted to try out the 32-bit Julia version.

@Jutho
Copy link
Owner

Jutho commented Sep 14, 2022

Oh right, I misinterpreted one line of my code (which could be improved). Still, 32bit would theoretically only allow 4GB of memory. Can you confirm that typeof(Sys.total_memory()) is UInt64 despite using 32-bit Julia?

@frankwswang
Copy link
Author

Oh right, I misinterpreted one line of my code (which could be improved). Still, 32bit would theoretically only allow 4GB of memory. Can you confirm that typeof(Sys.total_memory()) is UInt64 despite using 32-bit Julia?

Yes. I can confirm that on my machine, even when running a 32-bit Julia, typeof(Sys.total_memory()) is still UInt64.

@Jutho
Copy link
Owner

Jutho commented Sep 14, 2022

Ok, to fully support this, I would need to change a number of Int to Int32 variables (struct fields) in both LRUCache.jl and TensorOperations.jl

@Jutho
Copy link
Owner

Jutho commented Sep 15, 2022

Since I don't have a 32-bit julia installation at hand, what is the value of something like typeof(sizeof(randn(1,1))). Perhaps I should just change everything to Int64 explicitly to be on the safe side.

@frankwswang
Copy link
Author

Since I don't have a 32-bit julia installation at hand, what is the value of something like typeof(sizeof(randn(1,1))). Perhaps I should just change everything to Int64 explicitly to be on the safe side.

For typeof(sizeof(randn(1,1))) it's Int32.

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