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

Conditional evaluation changed unexpectedly since v0.36.0 #1446

Open
maresb opened this issue Feb 25, 2025 · 1 comment
Open

Conditional evaluation changed unexpectedly since v0.36.0 #1446

maresb opened this issue Feb 25, 2025 · 1 comment

Comments

@maresb
Copy link

maresb commented Feb 25, 2025

I'm working on a CUDA-enabled staged recipe, using rattler-build v0.36.0. The following is a MWE of the strange behavior I'm experiencing:

context:
  use_cuda: ${{ "true" if cuda_compiler_version != "None" else "false" }}

package:
  name: vllm
  version: 0.7.2

requirements:
  host:
  - if: use_cuda == "true"
    then:
    - use_cuda_is_true
    else:
    - use_cuda_not_true ==${{ cuda_compiler_version }}-${{ use_cuda }}
  - if: use_cuda == "false"
    then:
    - use_cuda_is_false
    else:
    - use_cuda_not_false

When I run with the staged-recipes cuda118 variant, I expect use_cuda == "true" to evaluate to true, and use_cuda == "false" to evaluate to false. Instead, both evaluate to false, even though the variables are set to their expected values as evidenced by the version number I constructed:

$ rattler-build build -m ../../.ci_support/linux64_cuda118.yaml

╭─ Finding outputs from recipe
 │ Loading variant config file: "../../.ci_support/linux64_cuda118.yaml"
 │ Loading variant config file: "/home/gcpuser/staged-recipes/recipes/vllm/conda_build_config.yaml"
 │ Loading variant config file: "../../.ci_support/linux64_cuda118.yaml"
 │ Found 1 variants
 │ 
 │ Build variant: vllm-0.7.2-h00ab004_0
 │ 
 │ ╭───────────────────────┬────────────╮
 │ │ Variant               ┆ Version    │
 │ ╞═══════════════════════╪════════════╡
 │ │ cuda_compiler_version ┆ "11.8"     │
 │ │ target_platform       ┆ "linux-64" │
 │ ╰───────────────────────┴────────────╯
 │
 ╰─────────────────── (took 0 seconds)

 ╭─ Running build for recipe: vllm-0.7.2-h00ab004_0
 │
 │ ╭─ Fetching source code
 │ │ No sources to fetch
 │ │
 │ ╰─────────────────── (took 0 seconds)
 │
 │ ╭─ Resolving environments
 │ │ 
 │ │ Resolving host environment:
 │ │   Platform: linux-64 [__unix=0=0, __linux=6.8.0=0, __glibc=2.35=0, __cuda=12.2=0, __archspec=1=cascadelake]
 │ │   Channels: 
 │ │    - file:///home/gcpuser/staged-recipes/recipes/vllm/output/
 │ │    - conda-forge
 │ │   Specs:
 │ │    - use_cuda_not_true ==11.8-true
 │ │    - use_cuda_not_false
 │ │
 │ ╰─────────────────── (took 1 second)
 │
 ╰─────────────────── (took 1 second)
Error:   × Failed to resolve dependencies: Cannot solve the request because of: No candidates were found for use_cuda_not_true ==11.8-
  │ true.
  │ 
  ╰─▶ Cannot solve the request because of: No candidates were found for use_cuda_not_true ==11.8-true.

If I downgrade to v0.35.9, then I get the expected behavior:

 │ │   Specs:
 │ │    - use_cuda_is_true
 │ │    - use_cuda_not_false
@shermansiu
Copy link

#1385 is related, particularly how Boolean strings in Jinja expressions are evaluated.

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