Skip to content

Instantly share code, notes, and snippets.

View giacaglia's full-sized avatar
💻
Coding!

Giuliano Pezzolo Giacaglia giacaglia

💻
Coding!
View GitHub Profile
python src/mnist-distributed.py -n 4 -g 8 -nr i
rank = args.nr * args.gpus + gpu
dist.init_process_group(
backend='nccl',
init_method='env://',
world_size=args.world_size,
rank=rank)
torch.manual_seed(0)
model = ConvNet()
torch.cuda.set_device(gpu)
# Save checkpoint
checkpoint = {
'model': model.state_dict(),
'optimizer': optimizer.state_dict(),
'amp': amp.state_dict()
}
torch.save(checkpoint, 'amp_checkpoint.pt')
...
@giacaglia
giacaglia / move_zeros_to_left.py
Created July 26, 2021 16:27
Move Zeros to the left of array
def move_zeros_to_left(array):
i = len(array) - 1
j = len(array) - 1
while i >= 0:
if array[i] != 0:
array[j] = array[i]
j -= 1
i -= 1
while j >= 0:
array[j] = 0
@giacaglia
giacaglia / test_function.py
Created July 26, 2021 16:29
Test function for move zeros to left
def test_function(test_case):
move_zeros_to_left(test_case[0])
if test_case[0] == test_case[1]:
print("Pass")
else:
print("Fail")
# ----------------------
# Git Aliases
# ----------------------
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add --all'
alias gau='git add --update'
alias gb='git branch'
alias gbd='git branch --delete '
alias gc='git commit'
@giacaglia
giacaglia / why_h2_didnt_fit_2026-05-14.md
Created May 15, 2026 03:24
Why hydrogen workflows didn't fit our refinery-targeted system — the 5 layers of mismatch + 3 paths to fix it

Why hydrogen workflows didn't fit our system — the 5 layers

Standards are part of it but not the whole story. There are about 5 layers of mismatch; standards are layer 1.

The 5 layers (concrete examples)

Layer 1: Standards — partial fix

Refinery uses IEC 61882, API 521, NACE MR0175, ASME Sec VIII, API 571.

@giacaglia
giacaglia / FINDINGS_2026-05-14_PUBLIC.md
Created May 15, 2026 03:51
Field test: running three customer projects through Tiros in a day

Field test: running three customer projects through Tiros in a day

Tiros is an AI engineering assistant for process plants — it ingests a project's source documents (drawings, datasheets, vendor packs) and produces structured engineering deliverables grounded in the relevant standards.

What we did

We ran the same Tiros pipeline end-to-end against three different customer engagements in a single day:

  1. A steam-turbine feasibility study for a refinery operator
  2. A hydrogen-production feasibility study for a renewables developer
@giacaglia
giacaglia / grading_report.md
Created May 19, 2026 02:50
TIROS pump-sizing (W-15) + line-sizing (W-35) validation against Korbut Case 3.8 — graded report

Case 3.8 — TIROS skill-chain grading report

Case: Demineralised Water Transfer (line sizing + fittings + pump sizing) Reference solution: Vladyslav Korbut, certified 2026-05-17 System under test: TIROS line-sizing (W-35) + pump-sizing (W-15) skill chains Run date: 2026-05-18 Project slug: case-3-8-pump-line-sizing Protocol: Skill-chain dispatch via Skill tool — extract-line-candidatesls-author-line (×2 lines) + extract-ps-candidatesps-author-pump; living-model equipment.md / streams.md / connectivity.md / tags.md / tr_numerics.md hand-authored from the xlsx (synthetic-input mode, NOT extractor-driven). Outputs.xlsx withheld from the skill chain; loaded only at grading time. Comparison baseline: the standalone-Opus run in projects/2026-05-18_case_3.8_handoff/grading_report.md (39/39 in-tolerance after cascade + elevation adjustments).

@giacaglia
giacaglia / corrections_note.md
Created May 19, 2026 03:10
Case 3.8 Outputs.xlsx — proposed Tier 2 discharge correction (1-cell copy-paste error + 5 cascade fixes)

Outputs.xlsx — Corrections note

Date applied: 2026-05-18 Reviewer: Claude Opus 4.7 (machine), pending Korbut human confirmation Status: PROPOSED — not certified. Please verify against your working calculation file before treating Outputs_corrected.xlsx as the new reference.

Suspected error