BioNeMo icon indicating copy to clipboard operation
BioNeMo copied to clipboard

Alphafold2 NIM performance tuning bug

Open robo-cap opened this issue 1 year ago • 1 comments

If you attempt to tune the performance of the AlphaFold's sequence to MSA function, the API returns a 500 Error.

This error is caused by the way the lack of conversion of the environment values (NIM_PARALLEL_THREADS_PER_MSA and NIM_PARALLEL_MSA_RUNNERS) to int in the /opt/inference.py file.

...
dbname_to_alignments = create_alignments(body.sequence,
                                   databases=dbs_to_ship,
                                   e_value=body.e_value,
                                   bit_score=body.bit_score,
                                   iterations=body.iterations,
                                   algorithm=body.algorithm,
                                   n_cpus_per_aln=os.environ.get("NIM_PARALLEL_THREADS_PER_MSA", 8), ## TODO: implement at API level
                                   n_workers=os.environ.get("NIM_PARALLEL_MSA_RUNNERS", 3), ## TODO: programatically set this.
                                   max_sto_sequences=body.max_msa_sequences)
...

robo-cap avatar Oct 01 '24 11:10 robo-cap

Have to answer since I know the answer to this, I fixed this in one of the subsequent versions of AF2 NIM, so this error should not pop up anymore. (It was just some spaghetti code for failing to cast the environment variables into an int for that function.)

That being said, I think those environment variables (NIM_PARALLEL_THREADS_PER_MSA and NIM_PARALLEL_MSA_RUNNERS) may not do anything for AF2 NIM with mmseqs2 (at the current moment, i.e. AF2 2.0.0).

Either way, this specific issue can be closed, since you will not be blocked by an error anymore! (Apologies for the late response, I don't think we monitor this repository yet for BioNeMo NIM.)

cspades avatar Dec 05 '24 00:12 cspades