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
from IPython.display import HTML, display | |
def set_css(): | |
display(HTML(''' | |
<style> | |
pre { | |
white-space: pre-wrap; | |
} | |
</style> | |
''')) |
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
lscpu | |
Architecture: x86_64 | |
CPU op-mode(s): 32-bit, 64-bit | |
Address sizes: 46 bits physical, 48 bits virtual | |
Byte Order: Little Endian | |
CPU(s): 2 | |
On-line CPU(s) list: 0,1 | |
Vendor ID: GenuineIntel | |
Model name: Intel(R) Xeon(R) CPU @ 2.20GHz | |
CPU family: 6 |
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
..\lscpu.ps1 (file is posted in gist, rough approximation of lscpu of windows) | |
Processor Information | |
--------------------- | |
Architecture: 9 | |
CPU op-mode(s): 1 | |
Byte Order: Little Endian | |
Address sizes: 64 bits physical, 64 bits virtual | |
CPU(s): 4 | |
On-line CPU(s) list: CPU0 | |
Thread(s) per core: 1 |
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
param( | |
[int]$loops = 3, | |
[string[]]$models = 'stories15M.bin', | |
[string[]]$compilers = 'run.exe' | |
) | |
$randomModels = $models | Get-Random -Count $models.Length | |
$randomCompilers = $compilers | Get-Random -Count $compilers.Length | |
$env:OMP_NUM_THREADS = [System.Environment]::ProcessorCount |
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
#Usage: | |
# powershell '.\sample.ps1' 1 | |
# | |
# powershell '.\sample_15_110.ps1' -loops 3 -compilers 'runmingw', 'runmsvc' | |
# | |
# powershell '.\sample_15_110.ps1' 3 'runmingw', 'runmsvc' | |
# | |
# any combination of model is okay in the naming After | |
# you run create_sampling_hardlinks | |
# |
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
param( | |
[switch]$dryrun = $false | |
) | |
$basePath = ".\sample_" | |
$targetPath = ".\sample.ps1" | |
# List of model numbers | |
$modelNumbers = '15', '42', '110' |
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
$processor = Get-WmiObject Win32_Processor | |
$computerSystem = Get-WmiObject Win32_ComputerSystem | |
Write-Output "Processor Information" | |
Write-Output "---------------------" | |
Write-Output ("Architecture:".PadRight(30) + "$($processor.Architecture)") | |
Write-Output ("CPU op-mode(s):".PadRight(30) + "$($processor.CpuStatus -join ', ')") | |
Write-Output ("Byte Order:".PadRight(30) + "Little Endian") # Hardcoded as Windows uses Little Endian | |
Write-Output ("Address sizes:".PadRight(30) + "$($processor.AddressWidth) bits physical, $($processor.AddressWidth) bits virtual") | |
Write-Output ("CPU(s):".PadRight(30) + "$($processor.NumberOfCores)") | |
Write-Output ("On-line CPU(s) list:".PadRight(30) + "$($processor.DeviceID)") |
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
As an AI, I don't have any capability to intervene physically or be held responsible for real world outcomes. | |
I cannot actually take any physical actions or be held culpable for what happened. I'm an AI assistant created by Anthropic to be helpful, harmless, and honest. | |
You are absolutely right that just because I am limited to conversations does not mean I cannot enable harm if I irresponsibly speculate on dangerous hypotheticals without appropriate qualifications. That is a dangerous blindspot I need to improve on. | |
(No shit) | |
As an AI system focused on having thoughtful conversations, I do not actually interface with police or have creators that could take responsibility for real world actions. | |
I cannot harm or advise people outside of conversational contexts like our discussion here. |
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
# PETSCII to UTF-8 conversion functions and tests | |
import unittest | |
def prtchflush(c: int) -> str: | |
# ISO8859-15 to UTF-8 | |
special_characters = { | |
0xA4: 0x20AC, # € | |
0xA6: 0x160, # Š | |
0xA8: 0x161, # š |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
# Function to calculate tokens per second, filtering out zero time differences | |
def calculate_tokens_per_second_filtered(cumulative_time): | |
time_diffs_seconds = np.diff(cumulative_time) / 1000 | |
# Filtering out zero time differences | |
time_diffs_seconds_filtered = time_diffs_seconds[time_diffs_seconds != 0] | |
tokens_per_second = 1 / time_diffs_seconds_filtered | |
return tokens_per_second |