Skip to content

Commit

Permalink
bug fix: large config
Browse files Browse the repository at this point in the history
  • Loading branch information
olive004 committed Nov 21, 2024
1 parent d8125e4 commit bba8e98
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 55 deletions.
3 changes: 1 addition & 2 deletions notebooks/25_sensitivity_peak_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -43,7 +43,6 @@
"from synbio_morpher.utils.misc.units import per_mol_to_per_molecule\n",
"from synbio_morpher.utils.common.setup import prepare_config, construct_circuit_from_cfg\n",
"from synbio_morpher.utils.data.data_format_tools.common import load_json_as_dict\n",
"from synbio_morpher.utils.circuit.agnostic_circuits.circuit_manager import CircuitModeller\n",
"from synbio_morpher.srv.io.manage.script_manager import script_preamble\n",
"from synbio_morpher.utils.circuit.agnostic_circuits.circuit_manager import CircuitModeller\n",
"from synbio_morpher.utils.misc.type_handling import flatten_listlike\n",
Expand Down
4 changes: 2 additions & 2 deletions run_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# from synbio_morpher.scripts.ensemble_generate_circuits.run_ensemble_generate_circuits import main
# from synbio_morpher.scripts.gather_interaction_stats.run_gather_interaction_stats import main
# from synbio_morpher.scripts.mutation_effect_on_interactions_signal.run_mutation_effect_on_interactions_signal import main
# from synbio_morpher.scripts.summarise_simulation.run_summarise_simulation import main
from synbio_morpher.scripts.summarise_simulation.run_summarise_simulation import main
# from synbio_morpher.scripts.analyse_mutated_templates.run_analyse_mutated_templates import main
# from synbio_morpher.scripts.vis_0_histplots.run_vis_0_histplots import main
# from synbio_morpher.scripts.vis_0_histplots_nosig.run_vis_0_histplots_nosig import main
Expand All @@ -22,7 +22,7 @@
# from synbio_morpher.scripts.vis_3_mutation_types_positions_2.run_vis_3_mutation_types_positions_2 import main
# from synbio_morpher.scripts.vis_4_histplots_thresholded.run_vis_4_histplots_thresholded import main
# from synbio_morpher.scripts.vis_5_means_analytics.run_vis_5_means_analytics import main
from synbio_morpher.scripts.ensemble_mutation_effect_analysis.run_ensemble_mutation_effect_analysis import main
# from synbio_morpher.scripts.ensemble_mutation_effect_analysis.run_ensemble_mutation_effect_analysis import main
# from synbio_morpher.scripts.ensemble_visualisation.run_ensemble_visualisation import main
# from synbio_morpher.scripts.parameter_based_simulation.run_parameter_based_simulation import main
# from synbio_morpher.scripts.stitch_parameter_grid.run_stitch_parameter_grid import main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"min_num_interacting": 0,
"min_num_self_interacting": 0,
"max_self_interacting": null,
"max_total": 10000,
"max_total": 20000,
"not_in_dirs": []
},
"mutations_args": {
Expand Down Expand Up @@ -92,7 +92,7 @@
"solver": "diffrax",
"use_batch_mutations": true,
"interaction_factor": 1,
"batch_size": 1000,
"batch_size": 3000,
"max_circuits": 60000,
"device": "gpu",
"threshold_steady_states": 0.05,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"molecular_params": "./synbio_morpher/utils/common/configs/RNA_circuit/molecular_params.json",
"circuit_generation": {
"repetitions": 300,
"repetitions": 500,
"species_count": 3,
"sequence_length": 20,
"generator_protocol": "random",
Expand Down Expand Up @@ -94,7 +94,7 @@
"interaction_factor": 1,
"batch_size": 800,
"max_circuits": 60000,
"device": "cpu",
"device": "gpu",
"threshold_steady_states": 0.05,
"use_initial_to_add_signal": false,
"use_rate_scaling": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
},
"source_dirs": {
"is_source_dir_incomplete": false,
"source_dir": ["./data/ensemble_mutation_effect_analysis/2023_07_17_105328/mutation_effect_on_interactions_signal"],
"source_dir": ["./data/ensemble_mutation_effect_analysis/2024_11_20_224946/mutation_effect_on_interactions_signal"],
"purpose_to_get_source_dir_from": null,
"source_dir_actually_used_POSTERITY": null
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ def __init__(self, result_writer=None, config: dict = {}) -> None:
self.debug_mode = config.get('experiment', {}).get('debug_mode', False)
self.sim_func = None

jax.config.update('jax_platform_name', config.get(
'simulation', {}).get('device', 'cpu'))
try:
jax.config.update('jax_platform_name', config.get(
'simulation', {}).get('device', 'gpu'))
except:
jax.config.update('jax_platform_name', 'cpu')
logging.warning(
'Could not set device to GPU, defaulting to CPU.')

if self.debug_mode:
jax.config.update("jax_disable_jit", True)
Expand Down Expand Up @@ -145,6 +150,7 @@ def write_interactions(self, circuit):
return circuit

def compute_interactions_batch(self, circuits: List[Circuit], batch=True):
""" This will not work with GPU """
# Make sure multi-threading is on
if self.simulator_args['name'] == 'IntaRNA':
if self.simulator_args['simulator_kwargs']['threads'] > 1:
Expand Down
44 changes: 0 additions & 44 deletions x_pyproject.toml

This file was deleted.

0 comments on commit bba8e98

Please sign in to comment.