From 07cc1ed1b5d1f6f342353c5e1f0d31a0843676e4 Mon Sep 17 00:00:00 2001 From: David Thrower Date: Thu, 9 Oct 2025 16:56:06 -0400 Subject: [PATCH 01/10] Update generative-proof-of-concept-CPU-preprocessing-in-memory.py More experimentation on example text prompts. --- ...-of-concept-CPU-preprocessing-in-memory.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/generative-proof-of-concept-CPU-preprocessing-in-memory.py b/generative-proof-of-concept-CPU-preprocessing-in-memory.py index 236eb5f..88c11b8 100644 --- a/generative-proof-of-concept-CPU-preprocessing-in-memory.py +++ b/generative-proof-of-concept-CPU-preprocessing-in-memory.py @@ -1190,12 +1190,19 @@ def test_text(test_prompt: str, max_new_tokens: int, sample_number: int, result: # Sample prompts to test: prompt_samples = [ - "I saw the sun and it was as shining on the", - "And God said to Moses:", - "In the beginning God created the ", - "And the earth was without form, and", - "And God said, Let there be light: and there ", - "Shall we all go to the river and" + # "I saw the sun and it was as shining on the", + # "And God said to Moses:", + # "In the beginning God created the ", + # "And the earth was without form, and", + # "And God said, Let there be light: and there ", + # "Shall we all go to the river and" + "Try to", + "You must go and", + "In the beginning God created the heavens", + "The earth was formless and empty, with darkness over", + "God called the light 'day' and the darkness 'night,' marking evening and morning", + "God called the expanse 'sky,' and there was", + "The earth brought forth grass, seed-bearing" ] From 96ae54c43fdb67f62fdc3c64ed983cc2c64bf4ed Mon Sep 17 00:00:00 2001 From: David Thrower Date: Thu, 9 Oct 2025 16:59:04 -0400 Subject: [PATCH 02/10] Update automerge.yml Trigger cicd tests... --- .github/workflows/automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index f4fbe4d..3fd135e 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -5,7 +5,7 @@ name: Python application on: push: - branches: [ "main", "254-more-optimizations-to-notgpt-hpo-script" ] + branches: [ "main", "255-copy-of-branch-254-updated-hpo-script-for-cicd-scale-testing" ] permissions: contents: read From 96deb86850269f788f14d8060b61b44ffc5663bd Mon Sep 17 00:00:00 2001 From: David Thrower Date: Thu, 9 Oct 2025 17:26:41 -0400 Subject: [PATCH 03/10] Update generative-proof-of-concept-CPU-preprocessing-in-memory.py Try more permutations of hyperparmas with the new dataset. --- ...-of-concept-CPU-preprocessing-in-memory.py | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/generative-proof-of-concept-CPU-preprocessing-in-memory.py b/generative-proof-of-concept-CPU-preprocessing-in-memory.py index 88c11b8..f6d6667 100644 --- a/generative-proof-of-concept-CPU-preprocessing-in-memory.py +++ b/generative-proof-of-concept-CPU-preprocessing-in-memory.py @@ -1159,8 +1159,25 @@ def test_text(test_prompt: str, max_new_tokens: int, sample_number: int, result: 'repetition_penalty': None, 'presence_penalty': 1.4, 'frequency_penalty': 1.4 + }, + { + 'max_new_tokens': max_new_tokens, + 'temperature': 0.6, + 'top_k': 40, + 'top_p': 0.96, + 'repetition_penalty': None, + 'presence_penalty': 1.4, + 'frequency_penalty': 1.4 + }, + { + 'max_new_tokens': max_new_tokens, + 'temperature': 0.7, + 'top_k': 45, + 'top_p': 0.97, + 'repetition_penalty': None, + 'presence_penalty': 1.4, + 'frequency_penalty': 1.3 } - ] # Default cases, no params response_1 = response = complete_text_greedy(text=test_prompt, max_new_tokens=max_new_tokens) @@ -1190,19 +1207,19 @@ def test_text(test_prompt: str, max_new_tokens: int, sample_number: int, result: # Sample prompts to test: prompt_samples = [ - # "I saw the sun and it was as shining on the", + "I saw the sun and it was as shining on the", # "And God said to Moses:", # "In the beginning God created the ", # "And the earth was without form, and", - # "And God said, Let there be light: and there ", + "And God said, Let there be light: and there ", # "Shall we all go to the river and" "Try to", - "You must go and", + # "You must go and", "In the beginning God created the heavens", "The earth was formless and empty, with darkness over", - "God called the light 'day' and the darkness 'night,' marking evening and morning", - "God called the expanse 'sky,' and there was", - "The earth brought forth grass, seed-bearing" + # "God called the light 'day' and the darkness 'night,' marking evening and morning", + # "God called the expanse 'sky,' and there was", + # "The earth brought forth grass, seed-bearing" ] From 671388772600c6a24a88385e67e9a571133568b0 Mon Sep 17 00:00:00 2001 From: David Thrower Date: Thu, 9 Oct 2025 17:46:55 -0400 Subject: [PATCH 04/10] Update generative-proof-of-concept-CPU-preprocessing-in-memory.py Try a top_p of 0.99. --- ...ative-proof-of-concept-CPU-preprocessing-in-memory.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/generative-proof-of-concept-CPU-preprocessing-in-memory.py b/generative-proof-of-concept-CPU-preprocessing-in-memory.py index f6d6667..aae5ca1 100644 --- a/generative-proof-of-concept-CPU-preprocessing-in-memory.py +++ b/generative-proof-of-concept-CPU-preprocessing-in-memory.py @@ -1177,6 +1177,15 @@ def test_text(test_prompt: str, max_new_tokens: int, sample_number: int, result: 'repetition_penalty': None, 'presence_penalty': 1.4, 'frequency_penalty': 1.3 + }, # + { + 'max_new_tokens': max_new_tokens, + 'temperature': 0.6, + 'top_k': 75, + 'top_p': 0.99, + 'repetition_penalty': None, + 'presence_penalty': 1.4, + 'frequency_penalty': 1.4 } ] # Default cases, no params From 7b4120af4de0e87524bdf1ce7ad8358278b23d31 Mon Sep 17 00:00:00 2001 From: David Thrower Date: Thu, 9 Oct 2025 18:07:27 -0400 Subject: [PATCH 05/10] Update generative-proof-of-concept-CPU-preprocessing-in-memory.py Try top_p 0.85 temperature 0.65, cut underperforming prompts. --- ...-proof-of-concept-CPU-preprocessing-in-memory.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/generative-proof-of-concept-CPU-preprocessing-in-memory.py b/generative-proof-of-concept-CPU-preprocessing-in-memory.py index aae5ca1..fe66c31 100644 --- a/generative-proof-of-concept-CPU-preprocessing-in-memory.py +++ b/generative-proof-of-concept-CPU-preprocessing-in-memory.py @@ -1186,6 +1186,15 @@ def test_text(test_prompt: str, max_new_tokens: int, sample_number: int, result: 'repetition_penalty': None, 'presence_penalty': 1.4, 'frequency_penalty': 1.4 + }, + { + 'max_new_tokens': max_new_tokens, + 'temperature': 0.65, + 'top_k': 75, + 'top_p': 0.985, + 'repetition_penalty': None, + 'presence_penalty': 1.4, + 'frequency_penalty': 1.4 } ] # Default cases, no params @@ -1222,10 +1231,10 @@ def test_text(test_prompt: str, max_new_tokens: int, sample_number: int, result: # "And the earth was without form, and", "And God said, Let there be light: and there ", # "Shall we all go to the river and" - "Try to", + # "Try to", # "You must go and", "In the beginning God created the heavens", - "The earth was formless and empty, with darkness over", + # "The earth was formless and empty, with darkness over", # "God called the light 'day' and the darkness 'night,' marking evening and morning", # "God called the expanse 'sky,' and there was", # "The earth brought forth grass, seed-bearing" From e4e65cfe4c8eb7c6cf68c9a6d0a193928e8cf066 Mon Sep 17 00:00:00 2001 From: David Thrower Date: Thu, 9 Oct 2025 19:19:08 -0400 Subject: [PATCH 06/10] Update generative-proof-of-concept-CPU-preprocessing-in-memory.py Try scaling up a tad. --- generative-proof-of-concept-CPU-preprocessing-in-memory.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generative-proof-of-concept-CPU-preprocessing-in-memory.py b/generative-proof-of-concept-CPU-preprocessing-in-memory.py index fe66c31..87e98e2 100644 --- a/generative-proof-of-concept-CPU-preprocessing-in-memory.py +++ b/generative-proof-of-concept-CPU-preprocessing-in-memory.py @@ -63,7 +63,7 @@ def objective(trial: optuna.Trial) -> float: # Number of text samples to create: # Number of text samples (of approximately max_seq_len) to create # Raises RAM in a linear fashion - SAMPLES_TO_CREATE = 10 # 681 + SAMPLES_TO_CREATE = 20 # 681 # How many tokens to provide before expecting the next token to be predicted. # Half this = double RAM (inversely proportional to RAM requirement) @@ -117,9 +117,9 @@ def objective(trial: optuna.Trial) -> float: epochs = trial.suggest_int('epochs', 10, 85) - batch_size = 10 # trial.suggest_int('batch_size', 5, 10) + batch_size = 5 # trial.suggest_int('batch_size', 5, 10) - gradient_accumulation_steps = trial.suggest_int('gradient_accumulation_steps', 1, 6) + gradient_accumulation_steps = trial.suggest_int('gradient_accumulation_steps', 1, 10) # Level constraints - ensure max >= min by setting min of max to value of min minimum_levels = trial.suggest_int('minimum_levels', 1, 3) From 77c690170b8ee7af8e3ff5d6ebaadc725b5dcc77 Mon Sep 17 00:00:00 2001 From: David Thrower Date: Thu, 9 Oct 2025 20:27:55 -0400 Subject: [PATCH 07/10] Update generative-proof-of-concept-CPU-preprocessing-in-memory.py Try a sample with lower penalty for repetition. temperature 0.8, top_p 0.99 --- ...ative-proof-of-concept-CPU-preprocessing-in-memory.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/generative-proof-of-concept-CPU-preprocessing-in-memory.py b/generative-proof-of-concept-CPU-preprocessing-in-memory.py index 87e98e2..aefbfca 100644 --- a/generative-proof-of-concept-CPU-preprocessing-in-memory.py +++ b/generative-proof-of-concept-CPU-preprocessing-in-memory.py @@ -1195,6 +1195,15 @@ def test_text(test_prompt: str, max_new_tokens: int, sample_number: int, result: 'repetition_penalty': None, 'presence_penalty': 1.4, 'frequency_penalty': 1.4 + }, + { + 'max_new_tokens': max_new_tokens, + 'temperature': 0.8, + 'top_k': 75, + 'top_p': 0.99, + 'repetition_penalty': None, + 'presence_penalty': 0.7, + 'frequency_penalty': 0.7 } ] # Default cases, no params From 4e443ceec94a6fb57b19b01bff585a2246fa666d Mon Sep 17 00:00:00 2001 From: David Thrower Date: Thu, 9 Oct 2025 20:43:28 -0400 Subject: [PATCH 08/10] Update generative-proof-of-concept-CPU-preprocessing-in-memory.py Added comment about perplexity score cutoff for production. --- generative-proof-of-concept-CPU-preprocessing-in-memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generative-proof-of-concept-CPU-preprocessing-in-memory.py b/generative-proof-of-concept-CPU-preprocessing-in-memory.py index aefbfca..945979a 100644 --- a/generative-proof-of-concept-CPU-preprocessing-in-memory.py +++ b/generative-proof-of-concept-CPU-preprocessing-in-memory.py @@ -86,7 +86,7 @@ def objective(trial: optuna.Trial) -> float: GENERATION_PROMPT_LEN = 10 MAX_NEW_TOKENS = MAX_SEQ_LENGTH - GENERATION_PROMPT_LEN - RESULT_CUTOFF = 20 # Only print out verbose text samples when perplexity is < RESULT_CUTOFF + RESULT_CUTOFF = 20 # 100 # <---<< In production 100 # Only print out verbose text samples when perplexity is < RESULT_CUTOFF if GENERATION_PROMPT_LEN + MAX_NEW_TOKENS > MAX_SEQ_LENGTH: raise ValueError("Sequence length overflow: Generated text length (GENERATION_PROMPT_LEN + MAX_NEW_TOKENS) " From 0730fad20afc33fbcf24ac2bf3406c9f10e4e59b Mon Sep 17 00:00:00 2001 From: David Thrower Date: Fri, 10 Oct 2025 13:25:25 -0400 Subject: [PATCH 09/10] Update neural_network_future.py Temporarily manually set jit_compile to True to check compatibility. --- cerebros/neuralnetworkfuture/neural_network_future.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cerebros/neuralnetworkfuture/neural_network_future.py b/cerebros/neuralnetworkfuture/neural_network_future.py index b7dea46..958a92e 100644 --- a/cerebros/neuralnetworkfuture/neural_network_future.py +++ b/cerebros/neuralnetworkfuture/neural_network_future.py @@ -341,7 +341,7 @@ def compile_neural_network(self): weight_decay=0.004, # Add weight decay parameter gradient_accumulation_steps=self.gradient_accumulation_steps ), - jit_compile=jit_compile) + jit_compile=Tree) # jit_compile) elif self.gradient_accumulation_steps == 1: self.materialized_neural_network.compile( loss=self.loss, From c251dec031014c7cd20816f6ceeaf2b6a16f989d Mon Sep 17 00:00:00 2001 From: David Thrower Date: Fri, 10 Oct 2025 13:44:50 -0400 Subject: [PATCH 10/10] Update neural_network_future.py Syntax errors... --- cerebros/neuralnetworkfuture/neural_network_future.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cerebros/neuralnetworkfuture/neural_network_future.py b/cerebros/neuralnetworkfuture/neural_network_future.py index 958a92e..8fe1000 100644 --- a/cerebros/neuralnetworkfuture/neural_network_future.py +++ b/cerebros/neuralnetworkfuture/neural_network_future.py @@ -341,7 +341,7 @@ def compile_neural_network(self): weight_decay=0.004, # Add weight decay parameter gradient_accumulation_steps=self.gradient_accumulation_steps ), - jit_compile=Tree) # jit_compile) + jit_compile=True) # jit_compile) elif self.gradient_accumulation_steps == 1: self.materialized_neural_network.compile( loss=self.loss, @@ -350,7 +350,7 @@ def compile_neural_network(self): learning_rate=self.learning_rate, weight_decay=0.004, # Add weight decay parameter ), - jit_compile=jit_compile) + jit_compile=True) # jit_compile=jit_compile) else: raise ValueError("gradient_accumulation_steps must be an int >= 0. You set it as {self.gradient_accumulation_steps} type {type(self.gradient_accumulation_steps)}")