Skip to content

Conversation

@GiggleLiu
Copy link
Member

@GiggleLiu GiggleLiu commented Sep 25, 2023

Added two extensions

  • TensorInferenceCUDAExt = "CUDA"
  • TensorInferenceGTNExt = "GenericTensorNetworks"

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #81 (75a021f) into main (248bdb5) will decrease coverage by 0.41%.
Report is 1 commits behind head on main.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
- Coverage   84.70%   84.29%   -0.41%     
==========================================
  Files          10       10              
  Lines         536      535       -1     
==========================================
- Hits          454      451       -3     
- Misses         82       84       +2     
Files Coverage Δ
ext/TensorInferenceGTNExt.jl 90.90% <100.00%> (ø)
src/TensorInference.jl 100.00% <ø> (ø)
src/mar.jl 94.54% <100.00%> (ø)
ext/TensorInferenceCUDAExt.jl 0.00% <0.00%> (ø)
src/utils.jl 88.97% <0.00%> (-0.71%) ⬇️

@GiggleLiu GiggleLiu requested a review from mroavi September 26, 2023 05:30
@mroavi
Copy link
Collaborator

mroavi commented Sep 26, 2023

I had an issue trying to run the tests on my machine:

(TensorInference) pkg> test
julia> ERROR: Compat `CUDA` not listed in `deps` or `extras` section.

@GiggleLiu
Copy link
Member Author

GiggleLiu commented Sep 26, 2023

I had an issue trying to run the tests on my machine:

(TensorInference) pkg> test
julia> ERROR: Compat `CUDA` not listed in `deps` or `extras` section.

What is your Julia version? The extensions feature requires Julia > 1.9. CUDA is listed in weakdeps, however your Julia does not check this section.

@mroavi
Copy link
Collaborator

mroavi commented Sep 26, 2023

Hmm, I see. I have Julia 1.8.5 installed on my machine. Given the requirement for Julia > 1.9 for the extensions feature, should we consider dropping support for the 1.8.x versions? Or is there a workaround to make it compatible with Julia 1.8.x?

@GiggleLiu
Copy link
Member Author

GiggleLiu commented Sep 26, 2023

The backward compatibility is discussed here: https://pkgdocs.julialang.org/v1.9/creating-packages/#Backwards-compatibility

However, I am against using compatibility treatment. For some users who want to stick to older version Julia, they can use older version of TensorInference.

We can either merge this PR directly, or merge it after the next julia LTS release. The previous LTS version is 1.6.

@mroavi
Copy link
Collaborator

mroavi commented Sep 26, 2023

Since we are planning to drop support for older Julia versions, I propose that we merge this once the next LTS version is released. Is there any way we could improve the error message above? The current error message does not clearly indicate that TensorInference.jl does not support versions prior to 1.9, even though we have specified 'julia = "1.9"' in the Project file.

@GiggleLiu
Copy link
Member Author

Since we are planning to drop support for older Julia versions, I propose that we merge this once the next LTS version is released. Is there any way we could improve the error message above? The current error message does not clearly indicate that TensorInference.jl does not support versions prior to 1.9, even though we have specified 'julia = "1.9"' in the Project file.

I think the package simply does not appear in the General registry in julia version < 1.9. If you are using Julia 1.8, it will fetch older versions for you. FYI: I have droped <1.9 version support in the latest OMEinsum.

But I agree we should at least wait for 1.10 (not nessesaryly LTS), which is another significant improvement comparing with 1.9. Then more people will switch to newer version.

@GiggleLiu
Copy link
Member Author

GiggleLiu commented Mar 25, 2025

Hi @mroavi , I factored out the problem specification in GenericTensorNetworks. Now they are specified in ProblemReductions.jl, a light weighted package that contains a lot of models that widely used in statistical physics, such as the SpinGlass and IndependentSet.
So I made it a dependency instead of an extension. It would be great if you could review this PR again and get it merged.

I have also tested the CUDA extension again on my local host to make sure it still works. Also, Julia v1.10 is LST, so I believe most users will accept the extension now. (Instead of Requires.jl)

@GiggleLiu
Copy link
Member Author

Hi Martin, I have to merge this PR and tag a new version since I need to use this feature in a course tomorrow. You can still take time to review this PR, and I will make the change in a new PR. Sorry about that.

@GiggleLiu GiggleLiu merged commit d83a5d6 into main Mar 25, 2025
2 checks passed
@mroavi
Copy link
Collaborator

mroavi commented Mar 25, 2025

Hi @GiggleLiu . I see you merged it already which is totally fine. I'm currently quite overloaded with my new job as teacher so I won't be able to react promptly.

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

Successfully merging this pull request may close these issues.

3 participants