{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import os\n", "import gzip\n", "import pickle\n", "import openai\n", "import torch.nn.functional as F\n", "import torch\n", "import re\n", "import copy\n", "from tqdm import tqdm\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from hardware_mapping import map_hardware_to_table\n", "hardware_instances = pd.read_csv('hardware_instances.csv') # columns: date,hardware\n", "hardware_instances = hardware_instances.assign(hardware_mapped = hardware_instances[\"hardware\"].apply(map_hardware_to_table))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for index, row in hardware_instances.iterrows():\n", " if row[\"hardware_mapped\"] == \"bfl single 'sc'\" and row[\"date\"] < \"2013-04-01\":\n", " hardware_instances.at[index, \"hardware_mapped\"] = \"bitforce sha256 single\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "hardware_instances.head(10)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "len(hardware_instances)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "efficiency = pd.read_csv('../../hardwarelist/hardware_merged.csv') # columns: hardware_name,Mhash/J\n", "efficiency = efficiency.rename(columns={\"hardware_name\":\"hardware_mapped\"})\n", "\n", "efficiency.head(2)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "joined = hardware_instances.merge(efficiency, on=\"hardware_mapped\", how=\"left\")\n", "joined = joined.dropna(subset=[\"Mhash/J\"])\n", "joined.head(4)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print(len(joined))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "table = joined[[\"date\",\"hardware_mapped\",\"Mhash/J\"]]\n", "table = table.rename(columns={\"hardware_mapped\":\"hardware_name\"})\n", "table[\"Mhash/J\"] = table[\"Mhash/J\"].astype(float).map(lambda x: x/1000000).map(lambda x: f\"{x:.10f}\")\n", "table = table.rename(columns={\"Mhash/J\":\"TH/J\"})\n", "table = table.sort_values([\"date\",\"hardware_name\"])\n", "table = table.reset_index(drop=True)\n", "table.head(8)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "# all of these are manually verified to be random noobs trying to use a gpu during the asic era\n", "for index, row in table.iterrows():\n", " eff = float(row[\"TH/J\"])\n", " if row[\"date\"] > \"2015-07-01\" and np.log10(eff*1000000) < 1.5:\n", " print(\"a\")\n", " # delete the row\n", " table = table.drop(index)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "table.to_csv(\"hardware_instances_with_efficiency.csv\", index=False)" ] } ], "metadata": { "kernelspec": { "display_name": "py310", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.13" } }, "nbformat": 4, "nbformat_minor": 2 }