Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds/updates a Nextflow-based execution path for running llmize (including Slurm/Apptainer support) and introduces a pipeline.py option intended to control where outputs are written.
Changes:
- Document Nextflow execution and model-cache behavior in
README.md. - Add
--work-dirtopipeline.pyand pass it from the Nextflow process. - Extend Nextflow configuration for an
igsSlurm/Apptainer GPU profile, including report/timeline output paths.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
README.md |
Adds a “Nextflow execution” section with usage examples and cache notes. |
pipeline.py |
Adds --work-dir and uses it to choose a default output path when --output is not provided. |
nextflow.config |
Introduces an igs Slurm/Apptainer profile and redirects report/timeline outputs under params.outdir. |
main.nf |
Updates the INTERPRET process to use a GPU label, set resource limits, configure OLLAMA_MODELS, and run pipeline.py in a container. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Suppressed comments (4)
nextflow.config:50
- In the GPU label block, both
clusterOptionsandcontainerOptionscan resolve to strings containingnullwhenslurm_accountorollama_models_dirare unset (e.g.--gres=gpu:1 -A null/-B null), which will fail at runtime. Make these options conditional (or set a non-null default for the profile).
// Allocate a gpu
clusterOptions = "--gres=gpu:1 -A ${params.slurm_account?.toString()?.trim()}"
// Enable Nvidia in apptainer and mount ollama dir
containerOptions = "--nv -B ${params.ollama_models_dir}"
README.md:63
- The docs mention an
igs_cpuprofile and claim theigs/igs_cpuprofiles defaultOLLAMA_MODELSto/usr/local/scratch/$USER/ollama/models, butnextflow.configcurrently defines onlyigsand does not set a defaultollama_models_dir. Either add/define those profiles + defaults, or adjust the README so it matches the actual configuration/required flags.
The Nextflow module uses an Ollama model cache directory via `OLLAMA_MODELS`.
- In the `igs` and `igs_cpu` profiles, the default cache path is user-specific scratch:
`/usr/local/scratch/$USER/ollama/models`
- On the first run, if the model is missing, the workflow auto-pulls it.
- On later runs, the same model is reused from scratch and pull is skipped.
pipeline.py:70
- The
--outputhelp text says the default output ends with.txt, butrun_pipeline()actually writes a.mdfile (and the README examples also show.md). This makes the CLI usage misleading.
parser.add_argument(
"--output", "-o",
default=None,
help="Path to save the final interpreted report text. Defaults to ./<input_stem>_interpretation_<timestamp>.txt.",
)
pipeline.py:178
default_output_name()is being called with".", which produces an odd stem (e.g.extracted_.) and can overwrite files across runs. It should derive the stem from the actual input JSON path (input_path).
if save_intermediates:
save_json(reduced, ".", extracted_filename or default_output_name(".", prefix="extracted_"))
save_json(report, ".", annotated_filename or "annotated_report.json")
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to the Nextflow pipeline for LLM-based interpretation, focusing on better GPU support, more flexible model caching, and simplified configuration. The main changes include enhanced documentation, more robust handling of the Ollama model cache directory, improved resource and container management for GPU execution, and streamlined output paths for intermediate and final results.
Pipeline and Execution Improvements:
README.mddetailing how the Nextflow workflow manages the Ollama model cache (OLLAMA_MODELS), including default paths, auto-pulling behavior, and instructions for overriding the cache location.INTERPRETprocess inmain.nfto support GPU execution with appropriate resource limits, dynamic container selection, and explicit environment setup for the Ollama model cache. [1] [2] [3]Configuration and Resource Management:
nextflow.configto addollama_models_dirandcontaineras parameters, improved GPU resource allocation under theigsprofile, and ensured proper mounting of the model cache directory in Apptainer containers.Output Path Simplification:
pipeline.pyto use the current directory instead of a hardcodeddatadirectory, making outputs more predictable and compatible with containerized execution. [1] [2] [3]These updates make the pipeline more portable, cluster-friendly, and easier to configure for different environments.