g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + chunkId + \".\" + \"dccdf937\" + \".chunk.js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"gpu_mem:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/gpu_poor/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkgpu_mem\"] = self[\"webpackChunkgpu_mem\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nexport default function _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}","import _typeof from \"./typeof.js\";\nexport default function _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n };\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import React from 'react';\n\nfunction TextInput(props) {\n// const [value, setValue] = useState(''); // useState hook to manage the input value\n \n const fun = props.setValue;\n let disableStatus = false;\n if ('disableStatus' in props){\n disableStatus = props.disableStatus\n }\n\n return (\n { fun(e.target.value); \n if (typeof props.setChange === 'function') {\n props.setChange(true);\n }\n }}\n onKeyDown={props.handleKeyDown}\n placeholder={props.placeholder}\n disabled={disableStatus}\n />\n );\n}\n\nexport default TextInput;\n","// textContent.js\nconst fullText = `\n Two of 'em. Both had my father in 'em. It's peculiar. I'm older now than he ever was by twenty years. So in a sense he's the younger man. Anyway, the first one I don't remember too well but it was about meetin' him in town somewheres and he give me some money and I think I lost it. But the second one it was like we was both back in the older times and I was a horseback goin' through the mountains of a night. Goin' through this pass in the mountains. It was cold and there was snow on the ground and he rode past me and kept on goin'. Never said nothin'. He just rode on past and he had this blanket wrapped around him and he had his head down and when he rode past I seen he was carryin' fire in a horn the way people used to do and I could see the horn from the light inside of it. About the color of the moon. And in the dream I knew that he was goin' on ahead and he was fixin' to make a fire somewhere out there in all that dark and all that cold and I knew that whenever I got there he would be there. And then I woke up.\n`;\n\n\n// const words = fullText.split(/[\\s,.;!?]+/)\n// console.log(words.length);\n\nexport default fullText;","import React, { useState, useEffect, useRef } from \"react\";\nimport TextInput from \"./textBox\";\nimport Modal from \"react-modal\";\nimport fullText from \"./textContent\";\nimport gpuJSONData from \"./gpu_config.json\";\nimport cpuJSONData from \"./cpu_config.json\";\n\nconst billion = 1000000000;\nconst tera = 1000000000 * 1000;\nlet configPath = \"/gpu_poor/all_configs.json\";\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n configPath = \"/gpu_poor/all_configs.json\";\n}\nconst MAX_FILE_SIZE = 500000;\nconst ggml_quants = [\n \"ggml_QK4_0\",\n \"ggml_QK4_1\",\n \"ggml_QK5_0\",\n \"ggml_QK5_1\",\n \"ggml_QK8_0\",\n \"ggml_QK8_1\",\n\n \"ggml_Q2_K\",\n\n \"ggml_Q3_K_L\",\n \"ggml_Q3_K_M\",\n\n \"ggml_QK4_K_M\",\n \"ggml_QK4_K_S\",\n\n \"ggml_QK5_K_M\",\n \"ggml_Q6_K\",\n];\n// console.log(configPath);\n\n/*\ndropdownTrnOrNot: 'inf', 'trn', 'inf_vLLM','inf_exL','inf_ggml'\ndropdownFullOrNot: 'lora_trn, 'full_trn', 'qlora'\ndropdownOpt: 'no_opt', 'sgd_opt','adam_opt'\ndropdownQuant: 'no_quant','bnb_int8','bnb_q4', \n*/\nconst specialNamesMapping = {\n \"meta-llama/Llama-2-7b\": \"meta-llama/Llama-2-7b-hf\",\n \"meta-llama/Llama-13-7b\": \"meta-llama/Llama-13-7b-hf\",\n \"meta-llama/Llama-2-70b\": \"meta-llama/Llama-13-70b-hf\",\n};\n\nfunction specialMapping(name) {\n if (name in specialNamesMapping) {\n return specialNamesMapping[name];\n }\n return name;\n}\n\nfunction getKey(keys, obj, defaultVal) {\n let toReturn = null;\n for (const key of keys) {\n if (obj.hasOwnProperty(key)) {\n // console.log(\"found: \",key);\n toReturn = obj[key];\n break;\n }\n }\n if (toReturn == null) {\n return defaultVal;\n }\n return toReturn;\n}\n\nfunction computeOverheadGGML(contextLen) {\n return 0.1 * contextLen;\n}\n\nfunction computeInferenceOnlyActivationMemory(contextLen, parsedConfig) {\n const hiddenDim = parsedConfig[\"hiddenDim\"];\n const heads = parsedConfig[\"heads\"];\n\n //return ((1000*4096*5)*2 + (1000*1000*32*2))/(1024*1024)\n return (\n (contextLen * hiddenDim * 5 * 2 + contextLen * contextLen * heads * 2) /\n (1024 * 1024)\n );\n}\n\n//floatBytes, quant\nfunction computeModelSizeGGML(parsedConfig, quant) {\n const vocab = parsedConfig[\"vocab\"],\n heads = parsedConfig[\"heads\"],\n numLayers = parsedConfig[\"num_layers\"],\n hiddenDim = parsedConfig[\"hiddenDim\"],\n interDim = parsedConfig[\"interDim\"];\n\n const totalParams =\n vocab * hiddenDim * 2 +\n numLayers * 4 * hiddenDim * hiddenDim +\n numLayers * 3 * interDim * hiddenDim;\n\n const other_v_down_params =\n numLayers * hiddenDim * hiddenDim + numLayers * hiddenDim * interDim;\n\n const other_params_Q2K =\n totalParams -\n (hiddenDim * hiddenDim * numLayers * 2 + 2 * vocab * hiddenDim);\n\n const mult_factor_dic = {\n ggml_QK4_0: 18,\n ggml_QK4_1: 20,\n ggml_QK5_0: 22,\n ggml_QK5_1: 24,\n ggml_QK8_0: 34,\n ggml_QK8_1: 40,\n };\n\n const mult_factor_dic_64 = {\n ggml_Q6_K: 54.0,\n ggml_Q3: 26.0,\n ggml_Q4: 38.0,\n ggml_Q5: 46.0,\n };\n\n //Q2_K is 22.0\n\n const mult_factor_dic_combination = {\n ggml_Q3_K_L: [38.0, 26.0],\n ggml_Q3_K_M: [46.0, 26.0],\n ggml_QK4_K_S: [46.0, 38.0],\n ggml_QK4_K_M: [54.0, 38.0],\n ggml_QK5_K_M: [54.0, 46.0],\n ggml_Q2_K: [26.0, 22.0],\n };\n\n let total = 0;\n if (mult_factor_dic.hasOwnProperty(quant)) {\n total = (mult_factor_dic[quant] * totalParams) / (32 * 1024 * 1024);\n }\n if (mult_factor_dic_64.hasOwnProperty(quant)) {\n total = (mult_factor_dic_64[quant] * totalParams) / (64 * 1024 * 1024);\n }\n if (mult_factor_dic_combination.hasOwnProperty(quant)) {\n const factors = mult_factor_dic_combination[quant];\n\n if (quant === \"ggml_Q2_K\") {\n total =\n ((totalParams - other_params_Q2K) * factors[1] +\n other_params_Q2K * factors[0]) /\n (64 * 1024 * 1024);\n } else {\n total =\n ((totalParams - other_v_down_params) * factors[1] +\n other_v_down_params * factors[0]) /\n (64 * 1024 * 1024);\n }\n }\n\n return total;\n}\n\nfunction computeModelSize(parsedConfig) {\n const vocab = parsedConfig[\"vocab\"],\n heads = parsedConfig[\"heads\"],\n numLayers = parsedConfig[\"num_layers\"],\n hiddenDim = parsedConfig[\"hiddenDim\"],\n interDim = parsedConfig[\"interDim\"];\n\n // console.log(vocab, heads, numLayers, hiddenDim, interDim);\n // let fB = floatBytes;\n // if (quant === 'bnb_int8'){fB = 1;}\n // if (quant === 'bnb_q4'){fB = 0.5;}\n\n const out =\n vocab * hiddenDim * 2 +\n numLayers * 4 * hiddenDim * hiddenDim +\n numLayers * 3 * interDim * hiddenDim;\n // console.log(\"this is out: \", out)\n\n return out;\n}\n\nfunction getGradOptMemory(\n dropdownFullOrNot,\n dropdownOpt,\n dropdownQuant,\n modelSize,\n floatBytes,\n parsedConfig,\n contextLen,\n batchSize = 1\n) {\n const full = dropdownFullOrNot,\n opt = dropdownOpt,\n quant = dropdownQuant;\n console.log(full, opt, quant);\n\n //QLora start\n // console.log(\"full: \", full);\n if (full === \"qlora\" && opt === \"adam_opt\") {\n //Need to check if q4 also takes extra memory\n console.log(\"calculating qlora\");\n return (\n parsedConfig.num_layers * 8 * parsedConfig.hiddenDim * 0.5 * 4 * 3 +\n getExtraMemory(parsedConfig, \"qlora\", contextLen) * batchSize\n );\n }\n if (full === \"qlora\" && opt === \"sgd_opt\") {\n //Need to check if q4 also takes extra memory\n return (\n parsedConfig.num_layers * 8 * parsedConfig.hiddenDim * 0.5 * 4 * 1 +\n getExtraMemory(parsedConfig, \"qlora\", contextLen) * batchSize\n );\n }\n //QLora end\n\n if (full === \"full_trn\" && opt === \"adam_opt\" && quant === \"no_quant\") {\n return modelSize * 3 * floatBytes;\n }\n\n if (full === \"full_trn\" && opt === \"adam_opt\" && quant === \"bnb_int8\") {\n return (\n modelSize * 3 * 1 +\n getExtraMemory(parsedConfig, quant, contextLen) * batchSize\n ); //Some extra mmeory that bnb int8 takes\n }\n\n if (full === \"full_trn\" && opt === \"adam_opt\" && quant === \"bnb_q4\") {\n //Need to check if q4 also takes extra memory\n return (\n modelSize * 3 * 0.5 +\n getExtraMemory(parsedConfig, quant, contextLen) * batchSize\n );\n }\n\n //------------\n if (full === \"full_trn\" && opt === \"sgd_opt\" && quant === \"no_quant\") {\n return modelSize * 1 * floatBytes;\n }\n\n if (full === \"full_trn\" && opt === \"sgd_opt\" && quant === \"bnb_int8\") {\n return (\n modelSize * 1 * 1 +\n getExtraMemory(parsedConfig, quant, contextLen) * batchSize\n );\n }\n\n if (full === \"full_trn\" && opt === \"sgd_opt\" && quant === \"bnb_q4\") {\n return (\n modelSize * 1 * 0.5 +\n getExtraMemory(parsedConfig, quant, contextLen) * batchSize\n );\n }\n\n //4*layer*8*hid*4*2\n\n //------------\n if (full === \"lora_trn\" && opt === \"adam_opt\" && quant === \"no_quant\") {\n return (\n parsedConfig.num_layers * 8 * parsedConfig.hiddenDim * 2 * 4 * 3 * 2\n );\n }\n\n if (full === \"lora_trn\" && opt === \"adam_opt\" && quant === \"bnb_int8\") {\n \n return (\n parsedConfig.num_layers * 8 * parsedConfig.hiddenDim * 2 * 4 * 3 +\n getExtraMemory(parsedConfig, quant, contextLen) * batchSize\n );\n }\n\n if (full === \"lora_trn\" && opt === \"adam_opt\" && quant === \"bnb_q4\") {\n return (\n parsedConfig.num_layers * 8 * parsedConfig.hiddenDim * 2 * 4 * 3 +\n getExtraMemory(parsedConfig, quant, contextLen) * batchSize\n );\n }\n\n //------------\n if (full === \"lora_trn\" && opt === \"sgd_opt\" && quant === \"no_quant\") {\n return parsedConfig.num_layers * 8 * parsedConfig.hiddenDim * 2 * 4 * 2;\n }\n\n if (full === \"lora_trn\" && opt === \"sgd_opt\" && quant === \"bnb_int8\") {\n return (\n parsedConfig.num_layers * 8 * parsedConfig.hiddenDim * 2 * 4 * 1 +\n getExtraMemory(parsedConfig, quant, contextLen) * batchSize\n );\n }\n\n if (full === \"lora_trn\" && opt === \"sgd_opt\" && quant === \"bnb_q4\") {\n return (\n parsedConfig.num_layers * 8 * parsedConfig.hiddenDim * 2 * 4 * 1 +\n getExtraMemory(parsedConfig, quant, contextLen) * batchSize\n );\n }\n\n console.log(full, opt, quant);\n throw new Error(\"Invalid combination of values\");\n}\n\nfunction getExtraMemory(parsedConfig, quant, contextLen) {\n const constant_8_extra = 0.75;\n const constant_4_extra = 1.0;\n const constant_qlora = 0.75;\n\n const common =\n (10 * parsedConfig.hiddenDim +\n 5 * parsedConfig.hiddenDim +\n 4 * parsedConfig.interDim +\n 2 * parsedConfig.interDim) *\n parsedConfig.num_layers;\n\n let extra_mem = 0;\n let contextLenSqrtRoot = 1.0;\n // if (contextLen > 100){\n // contextLenSqrtRoot = Math.round(Math.sqrt(contextLen));\n // }\n // else{\n // contextLenSqrtRoot = contextLen;\n // }\n const baseLen = 50;\n const ratioContextLen = contextLen / 50;\n if (ratioContextLen > 1.0) {\n contextLenSqrtRoot = Math.sqrt(ratioContextLen);\n }\n\n if (quant === \"bnb_int8\") {\n extra_mem =\n constant_8_extra * common * baseLen * contextLenSqrtRoot * 1.25;\n }\n\n if (quant === \"bnb_q4\") {\n extra_mem =\n constant_4_extra * common * baseLen * contextLenSqrtRoot * 1.0;\n }\n\n if (quant === \"qlora\") {\n extra_mem =\n constant_qlora * common * baseLen * contextLenSqrtRoot * 1.0;\n }\n\n console.log(\"extra mem\", extra_mem);\n return extra_mem;\n}\n\nfunction getExtraMemoryOld(parsedConfig, quant) {\n const constant_8_overhead = 200.0,\n constant_8_extra = 350.0;\n const constant_4_overhead = 350.0,\n constant_4_extra = 550.0;\n\n const common =\n (10 * parsedConfig.hiddenDim +\n 5 * parsedConfig.hiddenDim +\n 4 * parsedConfig.interDim +\n 2 * parsedConfig.interDim) *\n parsedConfig.num_layers;\n\n let extra_mem = 0;\n\n if (quant === \"bnb_int8\") {\n extra_mem = constant_8_overhead * common + constant_8_extra * common;\n }\n\n if (quant === \"bnb_q4\") {\n extra_mem = constant_4_overhead * common + constant_4_extra * common;\n }\n\n console.log(\"extra mem\", extra_mem);\n return extra_mem;\n}\n\nfunction getActivationMemory(\n parsedConfig,\n contextLen,\n floatBytes,\n quant,\n dropdownFullOrNot,\n batchSize = 1\n) {\n const heads = parsedConfig[\"heads\"],\n numLayers = parsedConfig[\"num_layers\"],\n hiddenDim = parsedConfig[\"hiddenDim\"],\n interDim = parsedConfig[\"interDim\"];\n\n let fB = floatBytes;\n const len = contextLen;\n\n // if (quant==='bnb_int8'){fB=1;}\n // if (quant==='bnb_q4'){fB=0.5;}\n\n console.log(\"activation: \", heads, numLayers, hiddenDim, interDim);\n\n //const attn_per_layer = qkv + qk (transpose) + attn mat + attn mat convert tp fp32 + attn mat divided by sqrt +\n const attn_per_layer =\n len * hiddenDim * 3 * fB +\n len * hiddenDim * 2 * fB +\n len * len * heads * fB +\n len * len * heads * 4 +\n len * len * heads * fB +\n len * hiddenDim * fB +\n len * hiddenDim * fB +\n len * hiddenDim * fB;\n\n // heads*len*len*4 + heads*len*len*fB + 3*hiddenDim*len*fB + hiddenDim*len*fB + hiddenDim*len*fB\n\n const ffn_per_layer =\n hiddenDim * len * fB +\n hiddenDim * len * fB +\n fB * 5 * len * interDim +\n interDim * len * fB;\n\n const norm = len * 4 * 2 + len * hiddenDim * fB * 6;\n\n let lora = 0;\n // if (dropdownFullOrNot==='lora_trn'){\n // lora = (8*len*2 + hiddenDim*len*2)*4;\n // }\n\n const total_per_layer = attn_per_layer + ffn_per_layer + norm + lora;\n console.log(\n \"total per layer: \",\n convertToMB(attn_per_layer),\n convertToMB(ffn_per_layer),\n convertToMB(norm),\n convertToMB(lora)\n );\n\n //total per layer: 4.2724609375 5.55419921875 6.409454345703125 8.02001953125\n let total = total_per_layer * numLayers;\n total = total * batchSize;\n\n console.log(\"this is total: \", total, attn_per_layer + ffn_per_layer);\n\n return total;\n}\n\nfunction checkCombinationTrainInference(\n quantType,\n setErrorMessage,\n openModal,\n typeOfTrn\n) {\n //! Can't train full with QLoRA\n if (typeOfTrn === \"full_trn\" && ggml_quants.includes(quantType)) {\n setErrorMessage(\"Can't use GGML for training\");\n openModal();\n return false;\n }\n if (typeOfTrn === \"qlora\" && quantType != \"no_quant\") {\n setErrorMessage(\n \"QLoRA is 4bit explicit. No need to select a quant type if you are training using QLoRA. Set it to 'None'\"\n );\n openModal();\n return false;\n }\n return true;\n}\n\nfunction checkCombinationInferenceTok(\n trnType,\n quantType,\n setErrorMessage,\n openModal\n) {\n if (ggml_quants.includes(quantType)) {\n if (trnType != \"inf_ggml\") {\n setErrorMessage(\n \"Invalid combination of inference type/quantization\"\n );\n openModal();\n return false;\n }\n }\n if (quantType != \"no_quant\" && trnType === \"inf_vLLM\") {\n setErrorMessage(\"vLLm doesn't support quant (maybe)\");\n openModal();\n return false;\n }\n if (\n trnType === \"inf_ggml\" &&\n (quantType === \"bnb_int8\" || quantType === \"bnb_q4\")\n ) {\n setErrorMessage(\"ggml doesn't support bnb\");\n openModal();\n return false;\n }\n\n\n return true;\n}\n\nfunction checkCombinationInference(\n trnType,\n quantType,\n setErrorMessage,\n openModal\n) {\n if (ggml_quants.includes(quantType)) {\n if (trnType != \"inf_ggml\") {\n setErrorMessage(\n \"Invalid combination of inference type/quantization\"\n );\n openModal();\n return false;\n }\n }\n if (quantType != \"no_quant\" && trnType === \"inf_vLLM\") {\n setErrorMessage(\"vLLm doesn't support quant (maybe)\");\n openModal();\n return false;\n }\n if (\n trnType === \"inf_ggml\" &&\n (quantType === \"bnb_int8\" || quantType === \"bnb_q4\")\n ) {\n setErrorMessage(\"ggml doesn't support bnb\");\n openModal();\n return false;\n }\n if (trnType === \"inf_ggml\" && quantType === \"no_quant\") {\n setErrorMessage(\n \"If you want no quant then pick vLLM/HF inference framework\"\n );\n openModal();\n return false;\n }\n\n if (trnType === \"inf_exL\") {\n setErrorMessage(\"exLlama hasn't been added yet :)\");\n openModal();\n return false;\n }\n return true;\n}\n\nfunction sanityUploadedConfig(jsonUploadedData, setErrorMessage, openModal) {\n function uploadError() {\n setErrorMessage(\n \"upload config doesn't have correct keys. make sure your config has the keys present in https://huggingface.co/codellama/CodeLlama-7b-hf/blob/main/config.json\"\n );\n openModal();\n return null;\n }\n\n if (Object.keys(jsonUploadedData).length === 0) {\n setErrorMessage(\"Uploaded json is empty :)\");\n openModal();\n return null; // JSON is empty\n }\n\n // console.log(jsonUploadedData);\n\n let vocab = 0,\n hiddenDim = 0,\n heads = 0,\n interDim = 0,\n num_layers = 0;\n\n if (jsonUploadedData.hasOwnProperty(\"vocab_size\")) {\n vocab = jsonUploadedData[\"vocab_size\"];\n } else {\n uploadError();\n return null;\n }\n\n if (jsonUploadedData.hasOwnProperty(\"hidden_size\")) {\n hiddenDim = jsonUploadedData[\"hidden_size\"];\n } else {\n uploadError();\n return null;\n }\n\n if (jsonUploadedData.hasOwnProperty(\"num_attention_heads\")) {\n heads = jsonUploadedData[\"num_attention_heads\"];\n } else {\n uploadError();\n return null;\n }\n\n if (jsonUploadedData.hasOwnProperty(\"intermediate_size\")) {\n interDim = jsonUploadedData[\"intermediate_size\"];\n } else {\n uploadError();\n return null;\n }\n\n if (jsonUploadedData.hasOwnProperty(\"num_hidden_layers\")) {\n num_layers = jsonUploadedData[\"num_hidden_layers\"];\n } else {\n uploadError();\n return null;\n }\n\n return {\n vocab: vocab,\n hiddenDim: hiddenDim,\n heads: heads,\n interDim: interDim,\n num_layers: num_layers,\n };\n}\n\nfunction getParseConfig(parsedJSONData, setErrorMessage, openModal) {\n console.log(Object.keys(parsedJSONData).length);\n if (Object.keys(parsedJSONData).length == 0) {\n setErrorMessage(\n \"Huggingface config of this id doesn't have correct keys. e.g. this is a ggml model. Please upload your config in correct format\"\n );\n openModal();\n return null;\n }\n\n const vocab = getKey([\"vocab_size\"], parsedJSONData, 32000);\n const hiddenDim = getKey(\n [\"hidden_size\", \"d_model\", \"n_embd\"],\n parsedJSONData,\n 768\n );\n const heads = getKey(\n [\"num_attention_heads\", \"num_heads\", \"n_head\"],\n parsedJSONData,\n 12\n );\n const interDim = getKey(\n [\"intermediate_size\", \"n_inner\", \"d_ff\"],\n parsedJSONData,\n hiddenDim * 4\n );\n const num_layers = getKey(\n [\"num_layers\", \"num_hidden_layers\", \"n_layer\"],\n parsedJSONData,\n 12\n );\n\n return {\n vocab: vocab,\n hiddenDim: hiddenDim,\n heads: heads,\n interDim: interDim,\n num_layers: num_layers,\n };\n}\n\nfunction getDefault(modelSize) {\n //If only model size is provided. Guess the values\n let vocab = null;\n let heads = null;\n let numLayers = null;\n\n function getApprox(modelSize) {\n let vocabR = null,\n headsR = null,\n numLayersR = null;\n if (modelSize < 5) {\n vocabR = 32000;\n headsR = 32;\n numLayersR = 24;\n return [vocabR, headsR, numLayersR];\n }\n if (modelSize < 10) {\n vocabR = 32000;\n headsR = 32;\n numLayersR = 32;\n return [vocabR, headsR, numLayersR];\n }\n if (modelSize < 24) {\n vocabR = 32000;\n headsR = 40;\n numLayersR = 40;\n return [vocabR, headsR, numLayersR];\n }\n\n if (modelSize < 55) {\n vocabR = 32000;\n headsR = 64;\n numLayersR = 48;\n return [vocabR, headsR, numLayersR];\n }\n\n vocabR = 32000;\n headsR = 64;\n numLayersR = 80;\n return [vocabR, headsR, numLayersR];\n }\n\n [vocab, heads, numLayers] = getApprox(modelSize);\n\n //vocab*h + numLayers*4*h*h + 3*4*h*h*numLayers = modelSize*10^9\n const A = numLayers * 4 + 3 * 4 * numLayers;\n const B = 2 * vocab;\n const C = -1 * modelSize * billion;\n\n let h = (-B + Math.sqrt(B * B - 4 * A * C)) / (2 * A);\n h = Math.ceil(h);\n\n return {\n vocab: vocab,\n hiddenDim: h,\n heads: heads,\n interDim: 4 * h,\n num_layers: numLayers,\n };\n}\n\nfunction convertToMB(value) {\n return value / (1024 * 1024);\n}\n\nfunction convertToMBModelSize(value, quant, typeOfTrn) {\n let extra = 0;\n let fB = 2;\n let size = (value * fB) / (1024 * 1024);\n if (quant === \"bnb_int8\" || quant === \"bnb_q4\" || typeOfTrn === \"qlora\") {\n extra = 0.06 * size;\n }\n\n if (quant === \"bnb_int8\") {\n size = size / 2;\n }\n if (quant === \"bnb_q4\") {\n size = size / 4;\n }\n\n if (typeOfTrn === \"qlora\") {\n size = size / 4 - (value * 2) / (64 * 1024 * 1024);\n }\n\n return size + extra;\n}\n\nfunction convertToBytes(floatType) {\n return 2.0;\n}\n\nfunction getAllComputedData(\n parsedJSONData,\n jsonUploadedData,\n modelSize,\n contextLen,\n floatType,\n selections,\n setErrorMessage,\n openModal,\n batchSize\n) {\n let parsedConfig = null,\n modelSizeinB = null;\n let activationMemory = 0,\n gradAndOptMemory = 0;\n let inferenceMemory = 0;\n let totalMemory = 0;\n const floatBytes = convertToBytes(floatType);\n const quantType = selections.dropdownQuant;\n const trnType = selections.dropdownTrnOrNot;\n const typeOfTrn = selections.dropdownFullOrNot;\n\n //trnType should be trnOrNot\n\n if (batchSize === \"\") {\n batchSize = \"1\";\n }\n\n let overHead = 650;\n if (!isValidPositiveInteger(contextLen)) {\n setErrorMessage(\n \"Context len can't be blank or have non numeric or negative/zero values.\"\n );\n openModal();\n return null;\n }\n\n if (!isValidPositiveInteger(batchSize)) {\n setErrorMessage(\n \"Batch size cant have non numeric or negative/zero values\"\n );\n openModal();\n return null;\n }\n\n if (parsedJSONData == null) {\n if (jsonUploadedData != null) {\n parsedConfig = sanityUploadedConfig(\n jsonUploadedData,\n setErrorMessage,\n openModal\n );\n console.log(parsedConfig, \"uploaded\");\n if (parsedConfig == null) {\n return null;\n }\n modelSizeinB = computeModelSize(parsedConfig);\n } else {\n if (!isNumberOrFloat(modelSize)) {\n console.log(\"error with model size\");\n setErrorMessage(\n \"Hugginface model id not available, enter model size(>0) or upload config\"\n );\n openModal();\n return null;\n }\n\n parsedConfig = getDefault(modelSize);\n modelSizeinB = modelSize * billion;\n }\n } else {\n parsedConfig = getParseConfig(\n parsedJSONData,\n setErrorMessage,\n openModal\n );\n if (parsedConfig == null) {\n return null;\n }\n console.log(parsedConfig);\n modelSizeinB = computeModelSize(parsedConfig);\n }\n\n let fB = floatBytes;\n if (quantType === \"bnb_int8\") {\n fB = 1;\n }\n if (quantType === \"bnb_q4\" || typeOfTrn === \"qlora\") {\n fB = 0.5;\n }\n let modelSizeinMB = convertToMBModelSize(\n modelSizeinB,\n quantType,\n typeOfTrn\n );\n // console.log(modelSizeinB);\n\n //!Inference\n if (trnType != \"trn\") {\n let checkSanity = checkCombinationInference(\n trnType,\n quantType,\n setErrorMessage,\n openModal\n );\n if (!checkSanity) {\n return null;\n }\n\n if (trnType === \"inf\" || trnType === \"inf_vLLM\") {\n let fB = 2;\n //If bnb quant\n if (quantType === \"bnb_int8\") {\n fB = 1;\n }\n if (quantType === \"bnb_q4\" || typeOfTrn === \"qlora\") {\n fB = 0.5;\n }\n\n inferenceMemory = convertToMB(\n 2 *\n contextLen *\n 2 *\n 2 *\n parsedConfig[\"hiddenDim\"] *\n parsedConfig[\"num_layers\"]\n );\n\n activationMemory = computeInferenceOnlyActivationMemory(\n contextLen,\n parsedConfig\n );\n\n console.log(\n \"HERE!!!\",\n inferenceMemory,\n modelSizeinMB,\n overHead,\n activationMemory\n );\n }\n if (trnType === \"inf_ggml\") {\n modelSizeinMB = computeModelSizeGGML(parsedConfig, quantType);\n inferenceMemory = convertToMB(\n 1 *\n contextLen *\n 2 *\n 2 *\n parsedConfig[\"hiddenDim\"] *\n parsedConfig[\"num_layers\"]\n );\n activationMemory = computeInferenceOnlyActivationMemory(\n contextLen,\n parsedConfig\n );\n overHead = overHead + computeOverheadGGML(contextLen);\n }\n\n totalMemory =\n inferenceMemory + modelSizeinMB + overHead + activationMemory;\n } else {\n // console.log(\"training!\");\n\n let checkSanity = checkCombinationTrainInference(\n quantType,\n setErrorMessage,\n openModal,\n typeOfTrn\n );\n if (!checkSanity) {\n return null;\n }\n //! Train\n activationMemory = getActivationMemory(\n parsedConfig,\n contextLen,\n floatBytes,\n quantType,\n typeOfTrn,\n batchSize\n );\n\n activationMemory = convertToMB(activationMemory);\n // console.log(\"got activation\", activationMemory);\n\n gradAndOptMemory = getGradOptMemory(\n typeOfTrn,\n selections.dropdownOpt,\n quantType,\n modelSizeinB,\n floatBytes,\n parsedConfig,\n contextLen,\n batchSize\n );\n\n // console.log(\"got gradOpt\", gradAndOptMemory);\n\n gradAndOptMemory = convertToMB(gradAndOptMemory);\n totalMemory = modelSizeinMB + gradAndOptMemory + activationMemory;\n\n console.log(\"got total\", totalMemory);\n\n totalMemory = totalMemory + overHead;\n }\n\n return {\n Total: Math.ceil(totalMemory),\n \"KV Cache\": Math.ceil(inferenceMemory),\n \"Model Size\": Math.ceil(modelSizeinMB),\n \"Activation Memory\": Math.ceil(activationMemory),\n \"Grad & Optimizer memory\": Math.ceil(gradAndOptMemory),\n \"cuda + other overhead\": overHead,\n };\n}\n\n///Users/rahulchand/gpu_mem/public/all_configs.json\nasync function fetchParams(name) {\n // let output = fetch('https://huggingface.co/meta-llama/Llama-2-7b/raw/main/params.json');\n\n let response = await fetch(configPath);\n response = await response.json();\n // console.log(response.hasOwnProperty(name));\n\n return response.hasOwnProperty(name) ? response[name] : null;\n}\n\n// function isNumberOrFloat(value) {\n// return /^-?\\d+(\\.\\d+)?$/.test(value);\n// }\n\nfunction isNumberOrFloat(value) {\n const num = parseFloat(value);\n return !isNaN(num) && num > 0;\n}\n\nfunction isValidPositiveInteger(input) {\n const num = parseFloat(input);\n console.log(num, input);\n // console.log(\"isvalid :\", input);\n\n return Number.isInteger(num) && num > 0;\n}\n\nfunction getGPUDataFromJSON() {}\n\nfunction App() {\n // let subtitle;\n const [modelSize, setModelSize] = useState(\"\");\n const [modelName, setModelName] = useState(\"meta-llama/Llama-2-7b-hf\");\n const [contextLen, setContextLen] = useState(\"\");\n\n const [promptLen, setPromptLen] = useState(\"\");\n\n const [batchSize, setBatchSize] = useState(1);\n const [totalMemoryShown, setTotalMemoryShown] = useState(0);\n\n const [gpuJsonDataForTable, setGPUJSONDataForTable] = useState([]);\n const [cpuJsonDataForTable, setCPUJSONDataForTable] = useState([]);\n\n // const [breakDownMemory, setBreakDownMemory] = useState(\" \");\n\n const [breakDownMemoryJson, setBreakDownMemoryJson] = useState([]);\n\n const [errorMessage, setErrorMessage] = useState(\"\");\n\n const [fileNameUpload, setFileNameUpload] = useState(\"\");\n\n const [modalIsOpen, setIsOpen] = React.useState(false);\n\n const [responseCache, setResponseCache] = useState(null);\n const [responseCacheKeys, setResponseCacheKeys] = useState(null);\n\n const [suggestions, setSuggestions] = useState([]);\n const [selectedIdx, setSelectedIdx] = useState(-1);\n const [tokenPerSecond, setTokenPerSecond] = useState(\"\");\n\n const [numGPU, setNumGPU] = useState(1);\n const [numGPUINeed, setNumGPUINeed] = useState(null);\n const [memReqHardwareName, setMemReqHardwareName] = useState(\"\");\n const [compReqHardwareName, setCompReqHardwareName] = useState(\"\");\n\n const [compReqHardwareNameBefore, setCompReqHardwareNameBefore] =\n useState(\"\");\n\n const [numOffload, setNumOffLoad] = useState(1);\n\n const [computedTokenPerSecond, setComputedTokenPerSecond] = useState(1);\n\n const [jsonData, setJsonData] = useState(null);\n\n const [jsonDataCompute, setJsonDataCompute] = useState(null);\n\n const [showSuggestions, setShowSuggestions] = useState(true);\n const [showDDR, setShowDDR] = useState([1, 0]);\n\n const [showTable, setShowTable] = useState(false);\n const [showTableGPU, setShowTableGPU] = useState(false);\n const [showTableCPU, setShowTableCPU] = useState(false);\n const [showTableCompute, setShowTableCompute] = useState(false);\n const [showTableComputeDisclaimer, setShowTableComputeDisclaimer] =\n useState(\"\");\n const [showTableComputeSmallInfo, setShowTableComputeSmallInfo] =\n useState(0);\n\n const [faqOpen, setFaqOpen] = useState(false);\n\n // const th_css = \"py-2 px-4 border bg-gray-200 text-gray-600 \";\n\n // const jsonDataSample = [\n // { index: 1, name: \"Alice\", value: 30 },\n // { index: 2, name: \"Bob\", value: 40 },\n // { index: 3, name: \"Carol\", value: 50 },\n // ];\n\n function openModal() {\n setIsOpen(true);\n }\n\n function closeModal() {\n setIsOpen(false);\n }\n\n const handleFileClear = (event) => {\n setFileNameUpload(\"\");\n setJsonData(null);\n // setTotalMemoryShown(\"\");\n // setBreakDownMemory(\"\");\n };\n\n const [displayedText, setDisplayedText] = useState(\"\");\n const [isVisible, setIsVisible] = useState(true);\n const intervalIdRef = useRef(null);\n const wordIndexRef = useRef(0);\n const timeoutIdRef = useRef(null);\n\n const handleClickGenerateText = () => {\n let token_per_second = parseInt(tokenPerSecond, 10);\n\n setIsVisible(true);\n const words = fullText.split(/[\\s,.;!?]+/);\n // console.log(words);\n wordIndexRef.current = 0; // reset word index\n setDisplayedText(\"\");\n\n // Clear any existing interval before setting up a new one\n if (intervalIdRef.current) {\n clearInterval(intervalIdRef.current);\n }\n if (timeoutIdRef.current) {\n clearTimeout(timeoutIdRef.current);\n }\n\n intervalIdRef.current = setInterval(() => {\n if (wordIndexRef.current < words.length - 1) {\n wordIndexRef.current++;\n setDisplayedText((prevText) => {\n if (prevText) {\n return prevText + \" \" + words[wordIndexRef.current];\n }\n return words[wordIndexRef.current]; // No preceding space for the first word\n });\n }\n }, 1000 / token_per_second);\n };\n\n const handleClearGeneratedText = () => {\n if (intervalIdRef.current) {\n clearInterval(intervalIdRef.current);\n }\n if (timeoutIdRef.current) {\n clearTimeout(timeoutIdRef.current);\n }\n setDisplayedText(\"\");\n setIsVisible(false);\n };\n\n useEffect(() => {\n return () => {\n if (intervalIdRef.current) {\n clearInterval(intervalIdRef.current);\n }\n if (timeoutIdRef.current) {\n clearTimeout(timeoutIdRef.current);\n }\n };\n }, []);\n\n const handleFileChange = (event) => {\n const file = event.target.files[0];\n if (file) {\n // Check file size\n if (file.size > MAX_FILE_SIZE) {\n alert(\"File is too large. Please upload a smaller JSON file.\");\n return;\n }\n\n const reader = new FileReader();\n reader.onload = (e) => {\n try {\n const json = JSON.parse(e.target.result);\n setJsonData(json);\n event.target.value = null;\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n alert(\"Invalid JSON file.\");\n }\n };\n setFileNameUpload(file.name);\n reader.readAsText(file);\n // console.log(jsonData);\n }\n };\n\n const [selections, setSelections] = useState({\n dropdownTrnOrNot: \"inf\",\n dropdownFullOrNot: \"full_trn\",\n dropdownOpt: \"adam_opt\",\n dropdownQuant: \"no_quant\",\n dropdownGPU: \"rtx-2060\",\n dropdownCPU: \"3600x\",\n dropdownDDR: \"ddr4\",\n isGPUorCPU: \"usingGPU\",\n });\n\n function setDDROptions(value) {\n let cpuSpecs = cpuJSONData[value];\n // console.log(\"calling: \", cpuSpecs);\n if (cpuSpecs[\"ddr4\"] == 1 && cpuSpecs[\"ddr5\"] == 1) {\n setShowDDR([1, 1]);\n return;\n }\n if (cpuSpecs[\"ddr4\"] == 1) {\n setShowDDR([1, 0]);\n return;\n }\n if (cpuSpecs[\"ddr5\"] == 1) {\n setShowDDR([0, 1]);\n return;\n }\n }\n\n const handleChangeSelection = (e) => {\n const { name, value } = e.target;\n setSelections((prevState) => ({\n ...prevState,\n [name]: value,\n }));\n\n if (name === \"dropdownCPU\") {\n setDDROptions(value);\n }\n };\n\n // const handleChangeInText1 = (event) => {\n // setModelSize(event.target.value);\n // };\n\n const [output1, setOutput1] = useState(\"\");\n\n function enchanceGPUJSONData(onlyNumGPUJsonData) {\n const newJsonData = {\n Name: selections.dropdownGPU.toUpperCase(),\n bandwidth: onlyNumGPUJsonData[\"bandwidth\"] + \" GB\",\n compute: onlyNumGPUJsonData[\"compute\"] + \" TFlops/s\",\n memory: onlyNumGPUJsonData[\"memory\"] + \" GB\",\n };\n return newJsonData;\n }\n\n function enchanceCPUJSONData(onlyNumCPUJsonData) {\n const newJsonData = {\n Name: selections.dropdownCPU.toUpperCase(),\n \"DDR5 Rated Speed\": onlyNumCPUJsonData[\"Speed\"] + \" MT/s\",\n \"DDR4 Rated Speed\": onlyNumCPUJsonData[\"speed_ddr4\"] + \" MT/s\",\n Cores: onlyNumCPUJsonData[\"Cores\"],\n \"DDR5 Support\": Boolean(onlyNumCPUJsonData[\"ddr5\"]).toString(),\n \"DDR4 Support\": Boolean(onlyNumCPUJsonData[\"ddr4\"]).toString(),\n \"Memory Bus\": onlyNumCPUJsonData[\"Bus\"] + \" Channel\",\n };\n // console.log(\"My data\");\n // console.log(newJsonData);\n return newJsonData;\n }\n\n // function getTotalFlops(parsedConfig){\n\n // let totalFlops = 0;\n // totalFlops += vocab*hiddenDim*2; //embedding\n // totalFlops += hiddenDim*hiddenDim*2 //qkvo\n\n // }\n\n function getTotalFlopsForKV(parsedConfig, batchSize, contextLen) {\n const hidDim = parsedConfig[\"hiddenDim\"];\n return 2 * contextLen * contextLen * hidDim * batchSize;\n }\n\n function convertGBToByte(sizeInGB) {\n return sizeInGB * 1024 * 1024 * 1024;\n }\n\n function convertByteToGB(sizeInByte) {\n return sizeInByte / (1024 * 1024 * 1024);\n }\n\n function convertByteToMB(sizeInByte) {\n return sizeInByte / (1024 * 1024);\n }\n\n function getFloatRatio_F16(quant) {\n return 1.0;\n }\n\n function getCPUSpeedFromSpecs(speed, speed_ddr4, bus, memory) {\n const busMap = { Dual: 2.0, Quad: 4.0, Hexa: 6.0, Octa: 8.0 };\n\n // console.log(\"speeds: \",speed, speed_ddr4, selections.dropdownDDR);\n\n let useThiSpeed = 0;\n if (selections.dropdownDDR==='ddr4'){\n useThiSpeed = speed_ddr4;\n }\n else{\n useThiSpeed = speed;\n }\n\n const busValue = busMap[bus];\n const rateMult = 8.0;\n\n const memInGBPerSecond = (busValue * rateMult * useThiSpeed) / 1024;\n\n return memInGBPerSecond;\n }\n\n function getFloatRatio_F16_CPU(quantType) {\n let k_values = [2, 3, 4, 5, 6, 8, 16];\n for (let k of k_values) {\n if (quantType.includes(k.toString())) {\n return k / 16;\n }\n }\n return 1.0;\n }\n\n function token_per_second_logic_CPU(\n cpuDataOnlyNum,\n parsedJSONData,\n promptLen,\n contextLen,\n batchSize,\n setErrorMessage,\n openModal\n ) {\n \n const speed = cpuDataOnlyNum[\"Speed\"];\n const speed_ddr4 = cpuDataOnlyNum[\"speed_ddr4\"];\n\n const bus = cpuDataOnlyNum[\"Bus\"];\n const memory = cpuDataOnlyNum[\"Memory\"];\n const cpu_compute = cpuDataOnlyNum[\"Flops\"] * 0.5;\n\n const cpu_bandwidth = getCPUSpeedFromSpecs(speed, speed_ddr4, bus, memory);\n\n const quantType = selections.dropdownQuant;\n\n let parsedConfig = getParseConfig(\n parsedJSONData,\n setErrorMessage,\n openModal\n );\n const numLayers = parsedConfig[\"num_layers\"],\n hiddenDim = parsedConfig[\"hiddenDim\"];\n\n let memoryTransfer =\n (computeModelSizeGGML(parsedConfig, quantType) * 1024 * 1024) / 2.0;\n if (quantType === \"no_quant\") {\n memoryTransfer = computeModelSize(parsedConfig);\n }\n\n \n\n const extraFactorCPU = 1.6;\n //! Prompt Time Calculation\n //Time to process prompt (depending on contextLen this is either compute bound or memory bound)\n //Since the prompts are usually (above >50, i think it is safe to say this is mostly COMPUTE BOUND)\n\n // console.log(\"this is memory: \",convertByteToMB(memoryTransfer),quantType);\n const totalLen = parseInt(contextLen) + parseInt(promptLen);\n // console.log(\n // \"Theory: \",\n // promptLen,\n // memoryTransfer,\n // numLayers,\n // hiddenDim,\n // batchSize\n // );\n let theoryTimePrompt =\n 2 * promptLen * memoryTransfer +\n 2 * numLayers * hiddenDim * hiddenDim * 2 * promptLen;\n theoryTimePrompt = batchSize * theoryTimePrompt;\n\n // console.log(\"first: \", theoryTimePrompt);\n let theoryTimePrompt_in_ms =\n theoryTimePrompt / (tera * (cpu_compute / 1000.0));\n\n // console.log(\"first: \",theoryTimePrompt_in_ms)\n console.log(\"mem trans: \", convertByteToMB(memoryTransfer));\n let finalPromptTime =\n theoryTimePrompt_in_ms * getFloatRatio_F16_CPU(quantType) +\n convertByteToMB(2 * memoryTransfer) * (0.008 / 1000);\n\n // const totalFlopsInB = 2*batchSize*modelSizeinB*billion + getTotalFlopsForKV(parsedConfig, batchSize, contextLen);\n\n //! Per token Time calculation\n const utilizationRate = 1.0;\n const kv_cache_memory = 2 * 2 * numLayers * hiddenDim * totalLen;\n\n //! Why is this 2* factor here? because of float16? -> Yes!\n let timeIfMemory =\n (convertByteToGB(2 * memoryTransfer + kv_cache_memory) /\n (utilizationRate * cpu_bandwidth)) *\n extraFactorCPU;\n let timeIfMemory_in_ms = timeIfMemory * 1000;\n\n //! Check if it is compute bound\n\n // console.log(\n // memoryTransfer,\n // numLayers,\n // hiddenDim,\n // batchSize,\n // cpu_compute,\n // extraFactorCPU\n // );\n let totalFlopsToken =\n 2 * memoryTransfer +\n 2 * totalLen * hiddenDim * 2 * numLayers * 2 * 2;\n totalFlopsToken = batchSize * totalFlopsToken;\n let timeIfFlops_in_ms =\n (totalFlopsToken * 1000) / (tera * (cpu_compute / 1000.0));\n timeIfFlops_in_ms = timeIfFlops_in_ms * extraFactorCPU;\n\n let finalTimeToConsider = null;\n let memoryOrCompute = null;\n\n if (timeIfMemory_in_ms > timeIfFlops_in_ms) {\n finalTimeToConsider = timeIfMemory_in_ms;\n memoryOrCompute = \"memory\";\n } else {\n finalTimeToConsider = timeIfFlops_in_ms;\n memoryOrCompute = \"compute\";\n }\n\n let token_per_s = 1000 / finalTimeToConsider; //finalTimeToConsider is time in ms for each token. So divide by 1000\n\n setComputedTokenPerSecond(Math.round(token_per_s));\n\n const jsonComputeReturnData = {\n \"Token/s\":\n Math.round(token_per_s) >= 1 ? Math.round(token_per_s) : \"< 1\",\n \"ms per token\": finalTimeToConsider.toFixed(2),\n // \"ms per token (compute bound)\": timeIfFlops_in_ms.toFixed(2),\n \"Prompt process Time (s)\": finalPromptTime.toFixed(2),\n \"memory or compute bound?\": memoryOrCompute,\n };\n\n setJsonDataCompute(jsonComputeReturnData);\n setShowTableCompute(true);\n }\n\n function token_per_second_logic_Train(\n gpuDataOnlyNum,\n parsedJSONData,\n promptLen,\n contextLen,\n batchSize,\n setErrorMessage,\n openModal\n ) {\n //! Training is most of the time compute bound\n const gpu_bandwidth = gpuDataOnlyNum[\"bandwidth\"];\n const gpu_compute = gpuDataOnlyNum[\"compute\"];\n\n const trnType = selections.dropdownTrnOrNot;\n const quantType = selections.dropdownQuant;\n const totalLen = parseInt(promptLen) + parseInt(contextLen);\n\n setShowTableComputeDisclaimer(\"\");\n let bnb_cost = 1.0;\n if (quantType === \"bnb_int8\") {\n setShowTableComputeDisclaimer(\n \"Disclaimer: bitsandbytes llm.int8 quant is NOT optimized for time. It takes more time than float16\"\n );\n bnb_cost = 3.0;\n }\n if (quantType === \"bnb_q4\") {\n setShowTableComputeDisclaimer(\n \"Disclaimer: https://github.com/TimDettmers/bitsandbytes/releases/tag/0.41.0 says that int4/qlora is 2-4x faster but I haven't been able to reproduce this. Other people have raised similar issues. \"\n );\n bnb_cost = 2.75;\n }\n if (quantType === \"qlora\") {\n setShowTableComputeDisclaimer(\n \"Disclaimer: https://github.com/TimDettmers/bitsandbytes/releases/tag/0.41.0 says that int4/qlora is 2-4x faster but I haven't been able to reproduce this. Other people have raised similar issues. \"\n );\n bnb_cost = 1.75;\n }\n\n let parsedConfig = getParseConfig(\n parsedJSONData,\n setErrorMessage,\n openModal\n );\n const numLayers = parsedConfig[\"num_layers\"],\n hiddenDim = parsedConfig[\"hiddenDim\"];\n\n const memoryTransfer = computeModelSize(parsedConfig);\n\n let totalFlopsToken =\n 2 * batchSize * totalLen * memoryTransfer +\n totalLen * hiddenDim * 2 * numLayers * batchSize;\n\n // console.log(batchSize, totalLen, memoryTransfer);\n // console.log(\n // \"other: \",\n // totalLen * hiddenDim * 2 * numLayers * batchSize\n // );\n\n // console.log(\n // 2 * memoryTransfer,\n // totalLen * hiddenDim * 2 * numLayers * 2\n // );\n\n let extraGradChoice = 1.0;\n if (selections.dropdownOpt === \"adam_opt\") {\n extraGradChoice = 1.15;\n }\n\n console.log(\"tot flops: \", totalFlopsToken);\n\n totalFlopsToken = totalFlopsToken * 2; //! Backward pass *2\n totalFlopsToken = totalFlopsToken * extraGradChoice;\n\n totalFlopsToken = totalFlopsToken * bnb_cost; //! Cost due to bnb\n\n if (selections.dropdownFullOrNot === \"full_trn\") {\n //! In total training, we will have to move the weights back to GPU for update, so its 2x more + update all so 1.5x (approx) more. Total 3x\n totalFlopsToken = totalFlopsToken * 3; //! I don't have capcacity to check this\n }\n\n let timeIfFlops_in_ms =\n (totalFlopsToken * 1000) / (tera * gpu_compute * 0.85);\n let memoryOrCompute = \"compute\";\n const jsonComputeReturnData = {\n \"ms per iteration(forward + backward)\":\n timeIfFlops_in_ms.toFixed(2),\n \"memory or compute bound?\": memoryOrCompute,\n };\n\n // console.log(jsonComputeReturnData);\n\n setJsonDataCompute(jsonComputeReturnData);\n setShowTableCompute(true);\n }\n\n function token_per_second_logic_GPU(\n gpuDataOnlyNum,\n parsedJSONData,\n promptLen,\n contextLen,\n batchSize,\n setErrorMessage,\n openModal\n ) {\n const gpu_bandwidth = gpuDataOnlyNum[\"bandwidth\"];\n const gpu_compute = gpuDataOnlyNum[\"compute\"];\n\n const trnType = selections.dropdownTrnOrNot;\n const quantType = selections.dropdownQuant;\n const totalLen = parseInt(promptLen) + parseInt(contextLen);\n\n let extraFactor = 1.0;\n\n if (trnType === \"inf\") {\n extraFactor = 2.0;\n }\n if (trnType === \"inf_ggml\") {\n extraFactor = 1.5;\n if (quantType === \"ggml_Q2_K\") {\n extraFactor = 2.0;\n }\n }\n\n if ((trnType === \"inf\") & (selections.dropdownFullOrNot === \"qlora\")) {\n setErrorMessage(\n \"afaik qlora trained model's inference is just 4 bit inference, i.e. bnb int4/nf4. You can select that option from quant to calculate this\"\n );\n openModal();\n return;\n }\n\n setShowTableComputeDisclaimer(\"\");\n let bnb_cost = 1.0;\n if (trnType === \"inf\" && quantType === \"bnb_int8\") {\n setShowTableComputeDisclaimer(\n \"Disclaimer: bitsandbytes llm.int8 quant is NOT optimized for inference. It takes more than time than float16.\"\n );\n bnb_cost = 4.5;\n }\n if (trnType === \"inf\" && quantType === \"bnb_q4\") {\n setShowTableComputeDisclaimer(\n \"Disclaimer: https://github.com/TimDettmers/bitsandbytes/releases/tag/0.41.0 says that int4 is 2-4x faster but I haven't been able to reproduce this. Other people have raised similar issues in the repo.\"\n );\n bnb_cost = 3.0;\n }\n\n let parsedConfig = getParseConfig(\n parsedJSONData,\n setErrorMessage,\n openModal\n );\n const numLayers = parsedConfig[\"num_layers\"],\n hiddenDim = parsedConfig[\"hiddenDim\"];\n\n let memoryTransfer = 0;\n if (ggml_quants.includes(quantType)) {\n memoryTransfer =\n (computeModelSizeGGML(parsedConfig, quantType) * 1024 * 1024) /\n 2.0;\n } else {\n if (quantType === \"no_quant\") {\n memoryTransfer = computeModelSize(parsedConfig);\n } else {\n if (quantType === \"bnb_int8\") {\n memoryTransfer = computeModelSize(parsedConfig) / 2.0;\n }\n if (quantType === \"bnb_q4\") {\n memoryTransfer = computeModelSize(parsedConfig) / 4.0;\n }\n }\n }\n\n //! Prompt Time Calculation\n //Time to process prompt (depending on contextLen this is either compute bound or memory bound)\n //Since the prompts are usually (above >50, i think it is safe to say this is mostly COMPUTE BOUND)\n\n let theoryTimePrompt =\n 2 * promptLen * memoryTransfer +\n 2 * numLayers * hiddenDim * hiddenDim * 2 * promptLen;\n theoryTimePrompt = batchSize * theoryTimePrompt;\n let theoryTimePrompt_in_ms =\n theoryTimePrompt / (tera * gpu_compute * 0.85);\n\n let finalPromptTime =\n theoryTimePrompt_in_ms * getFloatRatio_F16(quantType) * 1.8 +\n convertByteToMB(2 * memoryTransfer) * (0.008 / 100);\n\n // const totalFlopsInB = 2*batchSize*modelSizeinB*billion + getTotalFlopsForKV(parsedConfig, batchSize, contextLen);\n\n //! Per token Time calculation\n const utilizationRate = 1.0;\n const kv_cache_memory = 2 * 2 * numLayers * hiddenDim * totalLen;\n\n // console.log(\n // \"memory GPU side: \",\n // convertByteToMB(memoryTransfer),\n // memoryTransfer\n // );\n\n //1326940160*2\n\n let timeIfMemory =\n convertByteToGB(\n 2 * memoryTransfer * extraFactor + kv_cache_memory * extraFactor\n ) /\n (utilizationRate * gpu_bandwidth);\n let timeIfMemory_in_ms = timeIfMemory * 1000;\n\n //! Check if it is compute bound\n let totalFlopsToken =\n 2 * memoryTransfer + totalLen * hiddenDim * 2 * numLayers * 2 * 2;\n\n // console.log(\n // 2 * memoryTransfer,\n // totalLen * hiddenDim * 2 * numLayers * 2\n // );\n\n totalFlopsToken = batchSize * totalFlopsToken;\n let timeIfFlops_in_ms =\n (totalFlopsToken * 1000) / (tera * gpu_compute * 0.85);\n\n let finalTimeToConsider = null;\n let memoryOrCompute = null;\n\n if (timeIfMemory_in_ms > timeIfFlops_in_ms) {\n finalTimeToConsider = timeIfMemory_in_ms;\n memoryOrCompute = \"memory\";\n } else {\n finalTimeToConsider = timeIfFlops_in_ms;\n memoryOrCompute = \"compute\";\n }\n\n if (!isValidPositiveInteger(numGPU)) {\n setErrorMessage(\"Number of GPUs have to be positive number (>0)\");\n openModal();\n return;\n }\n\n if (numGPU > 1) {\n finalTimeToConsider = (finalTimeToConsider * 1.25) / numGPU;\n }\n\n finalTimeToConsider = finalTimeToConsider * bnb_cost;\n finalPromptTime = finalPromptTime * bnb_cost;\n\n let token_per_s = 1000 / finalTimeToConsider; //finalTimeToConsider is time in ms for each token. So divide by 1000\n\n setComputedTokenPerSecond(Math.round(token_per_s));\n\n const jsonComputeReturnData = {\n \"Token/s\":\n Math.round(token_per_s) >= 1 ? Math.round(token_per_s) : \"< 1\",\n \"ms per token\": finalTimeToConsider.toFixed(2),\n // \"ms per token (compute bound)\": timeIfFlops_in_ms.toFixed(2),\n \"Prompt process Time (s)\": finalPromptTime.toFixed(2),\n \"memory or compute bound?\": memoryOrCompute,\n };\n\n setJsonDataCompute(jsonComputeReturnData);\n setShowTableCompute(true);\n }\n\n function showGPUSpecs() {\n const gpuDataOnlyNum = gpuJSONData[selections.dropdownGPU];\n setGPUJSONDataForTable(enchanceGPUJSONData(gpuDataOnlyNum));\n setShowTableGPU(true);\n }\n\n function showCPUSpecs() {\n const cpuDataOnlyNum = cpuJSONData[selections.dropdownCPU];\n setCPUJSONDataForTable(enchanceCPUJSONData(cpuDataOnlyNum));\n setShowTableCPU(true);\n }\n\n function sanityChecks() {\n \n\n if (!isValidPositiveInteger(batchSize)) {\n setErrorMessage(\n \"Batch size cant have non numeric or negative/zero values\"\n );\n openModal();\n return false;\n }\n\n let check1 = checkCombinationInferenceTok(\n selections.dropdownTrnOrNot,\n selections.dropdownQuant,\n setErrorMessage,\n openModal\n );\n\n\n let check2 = checkCombinationTrainInference(\n selections.dropdownQuant,\n setErrorMessage,\n openModal,\n selections.dropdownFullOrNot\n );\n\n return check1 && check2;\n }\n\n function handleClickTokS() {\n // setErrorMessage(\"To be added\");\n // openModal();\n if (\n !isValidPositiveInteger(contextLen) ||\n !isValidPositiveInteger(promptLen)\n ) {\n setErrorMessage(\n \"context len & promt len should be positive numbers (>0)\"\n );\n openModal();\n return;\n }\n\n if (!sanityChecks()) {\n return;\n }\n\n if (\n selections.isGPUorCPU === \"usingCPU\" &&\n selections.dropdownTrnOrNot != \"inf_ggml\"\n ) {\n setErrorMessage(\n \"Inference with CPU only makes applicable(sensible) for GGML\"\n );\n openModal();\n return;\n }\n\n if (selections.dropdownTrnOrNot === \"inf_vLLM\") {\n setErrorMessage(\n \"Still working on adding vLLM. For now, as a rule of thumb, vLLM is 2-3x faster (than HF) when serving requests at your GPUs capacity\"\n );\n openModal();\n return;\n }\n\n // if (selections.dropdownTrnOrNot === \"trn\") {\n // setErrorMessage(\n // \"Token/s doesn't make sense for training, as whole sequence is generated at once. But how much time will one forward/backward pass take makese sense. I haven't added that yet.\"\n // );\n // openModal();\n // return;\n // }\n if (\n selections.dropdownTrnOrNot === \"trn\" &&\n selections.isGPUorCPU === \"usingCPU\"\n ) {\n setErrorMessage(\"You can't train using HuggingFace on CPU\");\n openModal();\n return;\n }\n\n // console.log(gpuJSONData);\n // console.log(cpuJSONData);\n // console.log(selections.dropdownGPU);\n\n const gpuDataOnlyNum = gpuJSONData[selections.dropdownGPU];\n const cpuDataOnlyNum = cpuJSONData[selections.dropdownCPU];\n\n let parsedConfig = responseCache.hasOwnProperty(modelName)\n ? responseCache[modelName]\n : null;\n\n if (parsedConfig === null) {\n setErrorMessage(\"Huggingface ID not present\");\n openModal();\n return;\n }\n\n\n if (selections.dropdownTrnOrNot === \"trn\") {\n token_per_second_logic_Train(\n gpuDataOnlyNum,\n parsedConfig,\n promptLen,\n contextLen,\n batchSize,\n setErrorMessage,\n openModal\n );\n setCompReqHardwareName(selections.dropdownGPU);\n setShowTableComputeSmallInfo(2);\n setCompReqHardwareNameBefore(\"Time for training: \");\n return;\n }\n\n if (selections.isGPUorCPU === \"usingGPU\") {\n //! If I have bnb4 or bnb8 selected then put a disclaimer that it doesn't work\n\n token_per_second_logic_GPU(\n gpuDataOnlyNum,\n parsedConfig,\n promptLen,\n contextLen,\n batchSize,\n setErrorMessage,\n openModal\n );\n setCompReqHardwareName(selections.dropdownGPU);\n setShowTableComputeSmallInfo(1);\n setCompReqHardwareNameBefore(\"Tokens/s stats for: \");\n } else {\n token_per_second_logic_CPU(\n cpuDataOnlyNum,\n parsedConfig,\n promptLen,\n contextLen,\n batchSize,\n setErrorMessage,\n openModal\n );\n setCompReqHardwareName(selections.dropdownCPU);\n setShowTableComputeSmallInfo(1);\n setCompReqHardwareNameBefore(\"Tokens/s stats for: \");\n }\n return;\n }\n\n async function handleReset() {\n setFileNameUpload(\"\");\n setJsonData(null);\n // setTotalMemoryShown(\"\");\n // setBreakDownMemory(\"\");\n setContextLen(1);\n setPromptLen(1);\n setShowTableGPU(false);\n setShowTable(false);\n setBatchSize(\"\");\n setModelSize(\"\");\n setModelName(\"\");\n setShowTableCPU(false);\n setShowTableCompute(false);\n }\n\n async function handleClick() {\n if (modelName.includes(\"GGML\") || modelName.includes(\"GGUF\")) {\n setErrorMessage(\n \"If you want info about GGML/GGUF models then enter the normal name & select GGML inference & quant type below. For example, if you want info about llama-2-7b.Q3_K_L.gguf then enter meta-llama/Llama-2-7b in the model name\"\n );\n openModal();\n return;\n }\n let parsedConfig = responseCache.hasOwnProperty(modelName)\n ? responseCache[modelName]\n : null;\n\n if (\n !isValidPositiveInteger(contextLen) ||\n !isValidPositiveInteger(promptLen)\n ) {\n setErrorMessage(\n \"context len & promt len should be positive numbers (>0)\"\n );\n openModal();\n }\n\n const out = getAllComputedData(\n parsedConfig,\n jsonData,\n modelSize,\n parseInt(contextLen) + parseInt(promptLen),\n 2,\n selections,\n setErrorMessage,\n openModal,\n batchSize\n );\n\n if (out == null) {\n return;\n }\n\n // setTotalMemoryShown(`Total Memory: ${out[\"Total\"]} MB`);\n // const jsonOut = JSON.stringify(out);\n // setBreakDownMemory(`Breakdown(in MB): ${jsonOut}`);\n setTotalMemoryShown(out[\"Total\"]);\n\n setShowTable(true);\n\n // setGPUJSONDataForTable(\n // enchanceGPUJSONData(gpuJSONData[selections.dropdownGPU])\n // );\n\n let numGPUsINeed = Math.ceil(\n out[\"Total\"] /\n (1024 * gpuJSONData[selections.dropdownGPU][\"memory\"])\n );\n // const nameOfGPUForNeed = selections.dropdownGPU + ' GPUs Needed'\n setNumGPUINeed(numGPUsINeed);\n setMemReqHardwareName(selections.dropdownGPU);\n setBreakDownMemoryJson(out);\n }\n\n // const handleClick = () => {\n\n // const trnVal = selections.dropdownTrnOrNot;\n // let totalMemory = 0;\n // let size = parseFloat(modelSize);\n // if (trnVal==='trn'){\n\n // }\n\n // console.log(modelSize);\n // console.log(isNumberOrFloat(modelSize));\n\n // // console.log(\"clicking\");\n // // setOutput1(selections.dropdownTrnOrNot + ' ' + selections.dropdownFullOrNot);\n\n // // console.log()\n\n // };\n\n useEffect(() => {\n // Your function here to populate myVariable\n const fetchData = async () => {\n\n // Fetch data or perform some other operation\n let response = await fetch(configPath);\n response = await response.json();\n setResponseCache(response);\n setResponseCacheKeys(Object.keys(response));\n };\n\n fetchData();\n }, []);\n\n useEffect(() => {\n if (modelName && responseCacheKeys) {\n if (modelName.length > 1) {\n const filtered = responseCacheKeys.filter((item) =>\n item.startsWith(modelName)\n );\n setSuggestions(filtered.slice(0, 10));\n } else {\n setSuggestions([]);\n }\n } else {\n setSuggestions([]);\n }\n }, [modelName]);\n\n // useEffect(() => {\n // if (modelName) {\n // if (modelName.length > 2) {\n // const filtered = responseCacheKeys.filter((item) =>\n // item.startsWith(modelName)\n // );\n // setSuggestions(filtered.slice(0, 10));\n // } else {\n // setSuggestions([]);\n // }\n // } else {\n // setSuggestions([]);\n // }\n // }, [modelName]);\n\n // console.log(responseCache);\n\n const handleKeyDown = (e) => {\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setSelectedIdx((prevIdx) =>\n Math.min(prevIdx + 1, suggestions.length - 1)\n );\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setSelectedIdx((prevIdx) => Math.max(prevIdx - 1, -1));\n } else if (e.key === \"Enter\" && selectedIdx >= 0) {\n setModelName(suggestions[selectedIdx]);\n setShowSuggestions(false);\n }\n };\n\n return (\n \n
\n \n
\n \n
\n Close\n \n
{errorMessage}
\n
\n \n
\n Are you GPU poor? {\" \"}\n 🫵🤨 \n
\n
\n Calculate GPU memory requirement and token/s for any LLM\n
\n
\n
\n
OR
\n
\n
\n
\n
\n
\n
\n
\n Name (Hugginface ID)\n \n\n
\n {modelName && showSuggestions && (\n
\n {suggestions.map((item, index) => (\n {\n setModelName(item);\n setShowSuggestions(false);\n \n }}\n className={`p-2 ${\n selectedIdx === index\n ? \"bg-gray-300\"\n : \"hover:bg-gray-200\"\n } cursor-pointer`}\n >\n {item}\n \n ))}\n \n )}\n\n
\n OR \n
\n
\n \n Size (in Billion)\n \n \n
\n {/*
OR
*/}\n {/*
\n
\n \n \n Upload model config\n \n \n {fileNameUpload}\n \n
\n
\n \n Clear file\n \n
\n
*/}\n
\n\n
\n
\n
\n \n Train or Inference?\n \n \n \n Inference (Huggingface)\n \n \n Inference (vLLM)\n \n {/* \n Inference (exLlama)\n */}\n \n Inference (GGML)\n \n \n Training (Huggingface)\n \n \n
\n\n
\n
\n \n Train method?\n \n \n \n Full\n \n \n LoRA\n \n QLoRA \n \n
\n
\n \n Optimizer?\n \n \n \n ADAM\n \n SGD \n \n
\n
\n \n Quant?\n \n \n \n None\n \n \n \n bnb int8\n \n \n bnb int4\n \n\n \n \n GGML Q2_K\n \n\n \n GGML Q3_K_L\n \n \n GGML Q3_K_M\n \n\n \n GGML QK4_0\n \n \n GGML QK4_1\n \n \n GGML QK4_K_M\n \n \n GGML QK4_K_S\n \n\n \n GGML QK5_0\n \n \n GGML QK5_1\n \n \n GGML QK5_K_M\n \n\n \n GGML Q6_K\n \n\n \n GGML QK8_0\n \n \n
\n
\n\n
\n
\n \n Prompt len?{\" \"}\n \n \n
\n
\n \n Tokens to Generate?{\" \"}\n \n \n
\n
\n \n Batch-size?{\" \"}\n \n \n
\n
\n
\n
\n
\n \n For Inference ⏱️\n \n
\n
\n \n GPU or CPU?\n \n \n GPU \n CPU \n \n \n \n \n
\n {selections.isGPUorCPU === \"usingGPU\" && (\n
\n
\n \n GPU\n \n \n \n RTX 2060\n \n \n RTX 2070\n \n \n RTX 3060\n \n \n RTX 3090\n \n \n RTX 4060\n \n \n RTX 4090\n \n \n P 100\n \n \n A 4000\n \n \n A 6000\n \n \n
\n
\n \n No. of GPUs?\n \n \n
\n
\n \n Get GPU specs\n \n
\n
\n )}\n\n {selections.isGPUorCPU === \"usingCPU\" && (\n
\n
\n \n CPU\n \n \n \n AMD 3600XT\n \n \n AMD 7950x\n \n \n i7-12700H\n \n \n i9-13900K\n \n \n i7-13700K\n \n \n i9 9900K\n \n \n AMD 5900X\n \n \n AMD 5600X\n \n \n AMD 3990X\n \n \n
\n {/*
\n \n Layers to offload?{\" \"}\n \n (to be added)\n \n \n \n
*/}\n
\n \n RAM?{\" \"}\n \n \n {showDDR[0] === 1 && (\n \n DDR4\n \n )}\n {showDDR[1] === 1 && (\n \n DDR5\n \n )}\n \n
\n
\n \n Get CPU specs\n \n
\n
\n )}\n
\n
\n
\n {/*
Generate Outputs */}\n
\n
\n \n Find Memory requirement\n \n
\n
\n \n Find ~tokens/s\n \n
\n
\n \n CLEAR\n \n
\n {/*
\n \n Reset\n \n
*/}\n
\n
\n
\n
\n
\n How does\n \n {\" \"}\n X{\" \"}\n \n tokens/s look like?\n
\n
\n
\n \n Enter Token/s:\n \n \n \n Generate Text\n \n \n Clear\n \n
\n
\n
\n {isVisible &&
{displayedText}
}\n
\n
\n
\n
\n
\n {/*
\n {totalMemoryShown}\n
*/}\n
\n
\n {showTable && (\n <>\n
\n Memory Requirement for:{\" \"}\n {/* {memReqHardwareName} */}\n
\n
\n \n {/* Total row */}\n \n \n Total\n \n \n \n {\" \"}\n {\n totalMemoryShown\n } MB{\" \"}\n \n \n \n\n {/* Breakdown row */}\n \n \n Breakdown\n \n \n\n {/* Name-Value pairs */}\n {Object.entries(\n breakDownMemoryJson\n ).map(([key, value], index) => {\n if (key === \"Total\") {\n return null; // Skip this iteration and return nothing\n }\n\n return (\n \n \n {key}\n \n \n {value} MB\n \n \n );\n })}\n \n \n selected GPUs needed\n \n \n {numGPUINeed}\n \n \n \n
\n >\n )}\n {/*
{\n navigator.clipboard.writeText(JSON.stringify(jsonData, null, 2));\n }}\n >\n Copy to Clipboard\n */}\n
\n
\n {showTableCompute && (\n
\n
\n {compReqHardwareNameBefore}\n {compReqHardwareName}\n
\n {/* {selections.isGPUorCPU==='usingGPU' ? selections.dropdownGPU : selections.dropdownCPU} */}\n
\n \n {/* Name-Value pairs */}\n {Object.entries(\n jsonDataCompute\n ).map(([key, value], index) => {\n if (key === \"Total\") {\n return null; // Skip this iteration and return nothing\n }\n\n return (\n \n \n {key}\n \n \n {value}\n \n \n );\n })}\n \n
\n
\n {showTableComputeDisclaimer}\n
\n {showTableComputeSmallInfo == 1 && (\n
\n Check above to see how{\" \"}\n {computedTokenPerSecond} token/s\n looks like\n
\n )}\n {showTableComputeSmallInfo == 2 && (\n
\n For train, generate length = 1.\n Since training is next token pred.\n e.g. if u train on 500 len sequence\n then put 500 in prompt len.\n
\n )}\n
\n )}\n {/*
{\n navigator.clipboard.writeText(JSON.stringify(jsonData, null, 2));\n }}\n >\n Copy to Clipboard\n */}\n
\n
\n
\n
\n {showTableGPU && (\n <>\n
\n GPU Info:\n
\n
\n \n {/* Total row */}\n {/* Name-Value pairs */}\n {Object.entries(\n gpuJsonDataForTable\n ).map(([key, value], index) => {\n return (\n \n \n {key}\n \n \n {value}\n \n \n );\n })}\n \n
\n >\n )}\n {/*
{\n navigator.clipboard.writeText(JSON.stringify(jsonData, null, 2));\n }}\n >\n Copy to Clipboard\n */}\n
\n
\n {showTableCPU && (\n <>\n
\n CPU Info:\n
\n
\n \n {/* Total row */}\n {/* Name-Value pairs */}\n {Object.entries(\n cpuJsonDataForTable\n ).map(([key, value], index) => {\n return (\n \n \n {key}\n \n \n {value}\n \n \n );\n })}\n \n
\n >\n )}\n {/*
{\n navigator.clipboard.writeText(JSON.stringify(jsonData, null, 2));\n }}\n >\n Copy to Clipboard\n */}\n
\n
\n {/*
{breakDownMemory}
*/}\n
\n \n
\n
setFaqOpen(!faqOpen)}\n >\n
\n Read FAQ 🔽\n \n \n\n {faqOpen && (\n
\n \n These are APPORXIMATE values. They can vary by\n +-15% depending on your CPU, GPU, cuda version,\n llama.cpp version, model etc.\n \n {/* \n For training, the total context length will be\n prompt Len + Generate Len. The correct (ideal)\n use case is to set generate = 1 for training,\n since all training is next token prediction\n loss.\n */}\n \n CPU inference is only compatible with GGML. You\n can't use CPU with HF/vLLM\n \n GPU + CPU is not yet supported \n \n )}\n
\n\n {/* \n PS: These are approximate values & may vary by 500MB-1GB\n depending on the GPU, model, input, cuda version etc. If\n your setup has ~1GB over the requirement you should likely\n be good.\n
\n */}\n {/* Show Values \n \n */}\n \n
\n );\n}\n\nexport default App;\n","import unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nexport default function _createForOfIteratorHelper(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (!it) {\n if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n var F = function F() {};\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n \n \n \n \n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"names":["canUseDOM","window","document","createElement","ExecutionEnvironment","canUseWorkers","Worker","canUseEventListeners","addEventListener","attachEvent","canUseViewport","screen","define","ReactPropTypesSecret","require","emptyFunction","emptyFunctionWithReset","resetWarningCache","module","exports","shim","props","propName","componentName","location","propFullName","secret","err","Error","name","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","aa","ca","p","a","b","c","arguments","length","encodeURIComponent","da","Set","ea","fa","ha","add","ia","ja","Object","prototype","hasOwnProperty","ka","la","ma","v","d","e","f","g","this","acceptsBooleans","attributeName","attributeNamespace","mustUseProperty","propertyName","type","sanitizeURL","removeEmptyString","z","split","forEach","toLowerCase","ra","sa","toUpperCase","ta","slice","pa","isNaN","qa","call","test","oa","removeAttribute","setAttribute","setAttributeNS","replace","xlinkHref","ua","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","va","Symbol","for","wa","ya","za","Aa","Ba","Ca","Da","Ea","Fa","Ga","Ha","Ia","Ja","iterator","Ka","La","A","assign","Ma","stack","trim","match","Na","Oa","prepareStackTrace","defineProperty","set","Reflect","construct","l","h","k","displayName","includes","Pa","tag","render","Qa","$$typeof","_context","_payload","_init","Ra","Sa","Ta","nodeName","Va","_valueTracker","getOwnPropertyDescriptor","constructor","get","configurable","enumerable","getValue","setValue","stopTracking","Ua","Wa","checked","value","Xa","activeElement","body","Ya","defaultChecked","defaultValue","_wrapperState","initialChecked","Za","initialValue","controlled","ab","bb","cb","db","ownerDocument","eb","Array","isArray","fb","options","selected","defaultSelected","disabled","gb","dangerouslySetInnerHTML","children","hb","ib","jb","textContent","kb","lb","mb","nb","namespaceURI","innerHTML","valueOf","toString","firstChild","removeChild","appendChild","MSApp","execUnsafeLocalFunction","ob","lastChild","nodeType","nodeValue","pb","animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","qb","rb","sb","style","indexOf","setProperty","keys","charAt","substring","tb","menuitem","area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","ub","vb","is","wb","xb","target","srcElement","correspondingUseElement","parentNode","yb","zb","Ab","Bb","Cb","stateNode","Db","Eb","push","Fb","Gb","Hb","Ib","Jb","Kb","Lb","Mb","removeEventListener","Nb","apply","m","onError","Ob","Pb","Qb","Rb","Sb","Tb","Vb","alternate","return","flags","Wb","memoizedState","dehydrated","Xb","Zb","child","sibling","current","Yb","$b","ac","unstable_scheduleCallback","bc","unstable_cancelCallback","cc","unstable_shouldYield","dc","unstable_requestPaint","B","unstable_now","ec","unstable_getCurrentPriorityLevel","fc","unstable_ImmediatePriority","gc","unstable_UserBlockingPriority","hc","unstable_NormalPriority","ic","unstable_LowPriority","jc","unstable_IdlePriority","kc","lc","oc","Math","clz32","pc","qc","log","LN2","rc","sc","tc","uc","pendingLanes","suspendedLanes","pingedLanes","entangledLanes","entanglements","vc","xc","yc","zc","Ac","eventTimes","Cc","C","Dc","Ec","Fc","Gc","Hc","Ic","Jc","Kc","Lc","Mc","Nc","Oc","Map","Pc","Qc","Rc","Sc","delete","pointerId","Tc","nativeEvent","blockedOn","domEventName","eventSystemFlags","targetContainers","Vc","Wc","priority","isDehydrated","containerInfo","Xc","Yc","dispatchEvent","shift","Zc","$c","ad","bd","cd","ReactCurrentBatchConfig","dd","ed","transition","fd","gd","hd","id","Uc","stopPropagation","jd","kd","ld","md","nd","od","keyCode","charCode","pd","qd","rd","_reactName","_targetInst","currentTarget","isDefaultPrevented","defaultPrevented","returnValue","isPropagationStopped","preventDefault","cancelBubble","persist","isPersistent","wd","xd","yd","sd","eventPhase","bubbles","cancelable","timeStamp","Date","now","isTrusted","td","ud","view","detail","vd","Ad","screenX","screenY","clientX","clientY","pageX","pageY","ctrlKey","shiftKey","altKey","metaKey","getModifierState","zd","button","buttons","relatedTarget","fromElement","toElement","movementX","movementY","Bd","Dd","dataTransfer","Fd","Hd","animationName","elapsedTime","pseudoElement","Id","clipboardData","Jd","Ld","data","Md","Esc","Spacebar","Left","Up","Right","Down","Del","Win","Menu","Apps","Scroll","MozPrintableKey","Nd","Od","Alt","Control","Meta","Shift","Pd","Qd","key","String","fromCharCode","code","repeat","locale","which","Rd","Td","width","height","pressure","tangentialPressure","tiltX","tiltY","twist","pointerType","isPrimary","Vd","touches","targetTouches","changedTouches","Xd","Yd","deltaX","wheelDeltaX","deltaY","wheelDeltaY","wheelDelta","deltaZ","deltaMode","Zd","$d","ae","be","documentMode","ce","de","ee","fe","ge","he","ie","le","color","date","datetime","email","month","password","range","search","tel","text","time","url","week","me","ne","oe","event","listeners","pe","qe","re","se","te","ue","ve","we","xe","ye","ze","oninput","Ae","detachEvent","Be","Ce","De","Ee","Fe","He","Ie","Je","Ke","offset","nextSibling","Le","contains","compareDocumentPosition","Me","HTMLIFrameElement","contentWindow","href","Ne","contentEditable","Oe","focusedElem","selectionRange","documentElement","start","end","selectionStart","selectionEnd","min","defaultView","getSelection","extend","rangeCount","anchorNode","anchorOffset","focusNode","focusOffset","createRange","setStart","removeAllRanges","addRange","setEnd","left","scrollLeft","top","scrollTop","focus","Pe","Qe","Re","Se","Te","Ue","Ve","We","animationend","animationiteration","animationstart","transitionend","Xe","Ye","Ze","animation","$e","af","bf","cf","df","ef","ff","gf","hf","lf","mf","concat","nf","Ub","instance","listener","D","of","has","pf","qf","rf","random","sf","bind","capture","passive","n","t","J","x","u","w","F","tf","uf","parentWindow","vf","wf","na","xa","$a","ba","je","char","ke","unshift","xf","yf","zf","Af","Bf","Cf","Df","Ef","__html","Ff","setTimeout","Gf","clearTimeout","Hf","Promise","Jf","queueMicrotask","resolve","then","catch","If","Kf","Lf","Mf","previousSibling","Nf","Of","Pf","Qf","Rf","Sf","Tf","Uf","E","G","Vf","H","Wf","Xf","Yf","contextTypes","__reactInternalMemoizedUnmaskedChildContext","__reactInternalMemoizedMaskedChildContext","Zf","childContextTypes","$f","ag","bg","getChildContext","cg","__reactInternalMemoizedMergedChildContext","dg","eg","fg","gg","hg","jg","kg","lg","mg","ng","og","pg","qg","rg","sg","tg","ug","vg","wg","xg","yg","I","zg","Ag","Bg","deletions","Cg","pendingProps","overflow","treeContext","retryLane","Dg","mode","Eg","Fg","Gg","memoizedProps","Hg","Ig","Jg","Kg","Lg","defaultProps","Mg","Ng","Og","Pg","Qg","Rg","_currentValue","Sg","childLanes","Tg","dependencies","firstContext","lanes","Ug","Vg","context","memoizedValue","next","Wg","Xg","Yg","interleaved","Zg","$g","ah","updateQueue","baseState","firstBaseUpdate","lastBaseUpdate","shared","pending","effects","bh","ch","eventTime","lane","payload","callback","dh","K","eh","fh","gh","q","r","y","hh","ih","jh","Component","refs","kh","nh","isMounted","_reactInternals","enqueueSetState","L","lh","mh","enqueueReplaceState","enqueueForceUpdate","oh","shouldComponentUpdate","isPureReactComponent","ph","contextType","state","updater","qh","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","rh","getDerivedStateFromProps","getSnapshotBeforeUpdate","UNSAFE_componentWillMount","componentWillMount","componentDidMount","sh","ref","_owner","_stringRef","th","join","uh","vh","index","wh","xh","yh","implementation","zh","Ah","done","Bh","Ch","Dh","Eh","Fh","Gh","Hh","Ih","tagName","Jh","Kh","Lh","M","Mh","revealOrder","Nh","Oh","_workInProgressVersionPrimary","Ph","ReactCurrentDispatcher","Qh","Rh","N","O","P","Sh","Th","Uh","Vh","Q","Wh","Xh","Yh","Zh","$h","ai","bi","ci","baseQueue","queue","di","ei","fi","lastRenderedReducer","action","hasEagerState","eagerState","lastRenderedState","dispatch","gi","hi","ii","ji","ki","getSnapshot","li","mi","R","ni","lastEffect","stores","oi","pi","qi","ri","create","destroy","deps","si","ti","ui","vi","wi","xi","yi","zi","Ai","Bi","Ci","Di","Ei","Fi","Gi","Hi","Ii","Ji","readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","identifierPrefix","Ki","message","digest","Li","Mi","console","error","Ni","WeakMap","Oi","Pi","Qi","Ri","getDerivedStateFromError","componentDidCatch","Si","componentStack","Ti","pingCache","Ui","Vi","Wi","Xi","ReactCurrentOwner","Yi","Zi","$i","aj","bj","compare","cj","dj","ej","baseLanes","cachePool","transitions","fj","gj","hj","ij","jj","UNSAFE_componentWillUpdate","componentWillUpdate","componentDidUpdate","kj","lj","pendingContext","mj","Aj","Bj","Cj","Dj","nj","oj","pj","fallback","qj","rj","tj","dataset","dgst","uj","vj","_reactRetry","sj","subtreeFlags","wj","xj","isBackwards","rendering","renderingStartTime","last","tail","tailMode","yj","Ej","S","Fj","Gj","wasMultiple","multiple","suppressHydrationWarning","onClick","onclick","size","createElementNS","autoFocus","createTextNode","T","Hj","Ij","Jj","Kj","U","Lj","WeakSet","V","Mj","W","Nj","Oj","Qj","Rj","Sj","Tj","Uj","Vj","Wj","insertBefore","_reactRootContainer","Xj","X","Yj","Zj","ak","onCommitFiberUnmount","componentWillUnmount","bk","ck","dk","ek","fk","isHidden","gk","hk","display","ik","jk","kk","lk","__reactInternalSnapshotBeforeUpdate","src","Wk","mk","ceil","nk","ok","pk","Y","Z","qk","rk","sk","tk","uk","Infinity","vk","wk","xk","yk","zk","Ak","Bk","Ck","Dk","Ek","callbackNode","expirationTimes","expiredLanes","wc","callbackPriority","ig","Fk","Gk","Hk","Ik","Jk","Kk","Lk","Mk","Nk","Ok","Pk","finishedWork","finishedLanes","Qk","timeoutHandle","Rk","Sk","Tk","Uk","Vk","mutableReadLanes","Bc","Pj","onCommitFiberRoot","mc","onRecoverableError","Xk","onPostCommitFiberRoot","Yk","Zk","al","isReactComponent","pendingChildren","bl","mutableSourceEagerHydrationData","cl","cache","pendingSuspenseBoundaries","el","fl","gl","hl","il","jl","zj","$k","ll","reportError","ml","_internalRoot","nl","ol","pl","ql","sl","rl","unmount","unstable_scheduleHydration","splice","querySelectorAll","JSON","stringify","form","tl","usingClientEntryPoint","Events","ul","findFiberByHostInstance","bundleType","version","rendererPackageName","vl","rendererConfig","overrideHookState","overrideHookStateDeletePath","overrideHookStateRenamePath","overrideProps","overridePropsDeletePath","overridePropsRenamePath","setErrorHandler","setSuspenseHandler","scheduleUpdate","currentDispatcherRef","findHostInstanceByFiber","findHostInstancesForRefresh","scheduleRefresh","scheduleRoot","setRefreshHandler","getCurrentFiber","reconcilerVersion","__REACT_DEVTOOLS_GLOBAL_HOOK__","wl","isDisabled","supportsFiber","inject","createPortal","dl","createRoot","unstable_strictMode","findDOMNode","flushSync","hydrate","hydrateRoot","hydratedSources","_getVersion","_source","unmountComponentAtNode","unstable_batchedUpdates","unstable_renderSubtreeIntoContainer","checkDCE","undefined","setState","nextProps","prevState","nextState","prevProps","__reactInternalSnapshotFlag","__reactInternalSnapshot","polyfill","foundWillMountName","foundWillReceivePropsName","foundWillUpdateName","newApiName","maybeSnapshot","snapshot","__suppressDeprecationWarning","bodyOpenClassName","portalClassName","_extends","i","_createClass","defineProperties","descriptor","writable","Constructor","protoProps","staticProps","_react","_react2","_interopRequireDefault","_reactDom2","_propTypes2","_ModalPortal2","ariaAppHider","obj","__esModule","newObj","default","_interopRequireWildcard","_safeHTMLElement","_safeHTMLElement2","_reactLifecyclesCompat","_possibleConstructorReturn","self","ReferenceError","isReact16","createHTMLElement","getCreatePortal","getParentElement","parentSelector","Modal","_Component","_ref","_temp","_this","TypeError","_classCallCheck","_len","args","_key","__proto__","getPrototypeOf","removePortal","parent","warn","portalRef","portal","renderPortal","defaultStyles","subClass","superClass","setPrototypeOf","_inherits","className","prevParent","nextParent","_","_props","isOpen","closesAt","closeTimeoutMS","beforeClose","closeWithTimeout","setElement","propTypes","content","overlay","htmlOpenClassName","afterOpen","overlayClassName","appElement","SafeHTMLCollection","SafeNodeList","onAfterOpen","onRequestClose","ariaHideApp","shouldFocusAfterRender","shouldCloseOnOverlayClick","shouldReturnFocusAfterClose","preventScroll","aria","role","contentLabel","shouldCloseOnEsc","overlayRef","contentRef","overlayElement","contentElement","contentEl","position","right","bottom","backgroundColor","border","background","WebkitOverflowScrolling","borderRadius","outline","padding","_typeof","focusManager","_scopeTab2","classList","_portalOpenInstances2","CLASS_NAMES","ariaHiddenInstances","ModalPortal","setOverlayRef","setContentRef","afterClose","_this$props","parentDocument","remove","getElementsByTagName","show","returnFocus","teardownScopedFocus","popWithoutFocus","onAfterClose","deregister","open","beforeOpen","closeTimer","setupScopedFocus","markForFocusLater","openAnimationFrame","requestAnimationFrame","overlayEl","close","closeWithoutTimeout","focusContent","contentHasFocus","handleKeyDown","isTabKey","isEscKey","requestClose","handleOverlayOnClick","shouldClose","ownerHandlesClose","handleContentOnMouseUp","handleOverlayOnMouseDown","handleContentOnClick","handleContentOnMouseDown","shouldBeClosed","buildClassName","additional","classNames","attributesFromObject","prefix","items","reduce","acc","moveFromContentToOverlay","cancelAnimationFrame","hide","register","_props2","contentStyles","overlayStyles","overlayProps","onMouseDown","contentProps","tabIndex","onKeyDown","onMouseUp","modal","testId","resetState","globalElement","process","assertNodeList","useElement","validateElement","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","documentNotReadyOrSSRTesting","_warning","_warning2","nodeList","selector","HTMLCollection","NodeList","_arr","before","after","_i","item","instances","_arr2","_i2","check","_portalOpenInstances","subscribe","eventType","openInstances","cloneNode","parentElement","htmlElement","cls","htmlClassList","removeClass","_cls","docBodyClassList","at","classString","classListRef","poll","incrementReference","decrementReference","focusLaterElements","handleBlur","handleFocus","toFocus","pop","modalElement","_tabbable","_tabbable2","needToFocus","portalOpenInstances","PortalOpenInstances","openInstance","emit","subscribers","subscriber","_exenv","EE","SafeHTMLElement","HTMLElement","tabbable","head","getActiveElement","checkSafari","exec","navigator","userAgent","shadowRoot","findTabbableDescendants","descendants","finished","filter","DISPLAY_NONE","DISPLAY_CONTENTS","tabbableNode","hidesContents","zeroSize","offsetWidth","offsetHeight","getComputedStyle","displayValue","getPropertyValue","scrollWidth","scrollHeight","isNotOverflowing","exception","focusable","isTabIndexNotNaN","rootNode","getRootNode","host","visible","getAttribute","isTabIndexNaN","_Modal","_Modal2","__self","__source","Fragment","jsx","jsxs","forceUpdate","escape","_status","_result","Children","map","count","toArray","only","Profiler","PureComponent","StrictMode","Suspense","cloneElement","createContext","_currentValue2","_threadCount","Provider","Consumer","_defaultValue","_globalName","createFactory","createRef","forwardRef","isValidElement","lazy","memo","startTransition","unstable_act","sortIndex","performance","setImmediate","startTime","expirationTime","priorityLevel","scheduling","isInputPending","MessageChannel","port2","port1","onmessage","postMessage","unstable_Profiling","unstable_continueExecution","unstable_forceFrameRate","floor","unstable_getFirstCallbackNode","unstable_next","unstable_pauseExecution","unstable_runWithPriority","delay","unstable_wrapCallback","warning","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","definition","o","chunkId","all","promises","miniCssF","prop","inProgress","dataWebpackPrefix","script","needAttach","scripts","s","charset","timeout","nc","onScriptComplete","prev","onerror","onload","doneFns","fn","toStringTag","installedChunks","j","installedChunkData","promise","reject","errorType","realSrc","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","_toPropertyKey","arg","hint","prim","toPrimitive","res","Number","_defineProperty","ownKeys","getOwnPropertySymbols","_objectSpread2","getOwnPropertyDescriptors","asyncIterator","wrap","Generator","Context","makeInvokeMethod","tryCatch","GeneratorFunction","GeneratorFunctionPrototype","values","defineIteratorMethods","_invoke","AsyncIterator","invoke","__await","callInvokeWithMethodAndArg","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","isGeneratorFunction","mark","awrap","async","reverse","stop","rval","handle","complete","finish","delegateYield","asyncGeneratorStep","gen","_next","_throw","info","_arrayLikeToArray","arr","len","arr2","_unsupportedIterableToArray","minLen","from","_slicedToArray","fun","disableStatus","_jsx","onChange","setChange","placeholder","billion","tera","configPath","hostname","ggml_quants","getKey","defaultVal","toReturn","allowArrayLike","it","_e","normalCompletion","didErr","step","_e2","_createForOfIteratorHelper","computeInferenceOnlyActivationMemory","contextLen","parsedConfig","computeModelSizeGGML","quant","vocab","numLayers","hiddenDim","interDim","totalParams","other_v_down_params","other_params_Q2K","mult_factor_dic","ggml_QK4_0","ggml_QK4_1","ggml_QK5_0","ggml_QK5_1","ggml_QK8_0","ggml_QK8_1","mult_factor_dic_64","ggml_Q6_K","ggml_Q3","ggml_Q4","ggml_Q5","mult_factor_dic_combination","ggml_Q3_K_L","ggml_Q3_K_M","ggml_QK4_K_S","ggml_QK4_K_M","ggml_QK5_K_M","ggml_Q2_K","total","factors","computeModelSize","getExtraMemory","common","num_layers","extra_mem","contextLenSqrtRoot","ratioContextLen","sqrt","checkCombinationTrainInference","quantType","setErrorMessage","openModal","typeOfTrn","getParseConfig","parsedJSONData","heads","convertToMB","getAllComputedData","jsonUploadedData","modelSize","floatType","selections","batchSize","modelSizeinB","activationMemory","gradAndOptMemory","inferenceMemory","totalMemory","dropdownQuant","trnType","dropdownTrnOrNot","dropdownFullOrNot","overHead","isValidPositiveInteger","uploadError","sanityUploadedConfig","num","parseFloat","isNumberOrFloat","_getApprox","getApprox","_getApprox2","getDefault","modelSizeinMB","extra","convertToMBModelSize","checkSanity","checkCombinationInference","computeOverheadGGML","floatBytes","fB","attn_per_layer","ffn_per_layer","norm","total_per_layer","getActivationMemory","dropdownOpt","full","opt","getGradOptMemory","Total","isInteger","_handleReset","_handleClick","_useState2","setModelSize","_useState4","modelName","setModelName","_useState6","setContextLen","_useState8","promptLen","setPromptLen","_useState10","setBatchSize","_useState12","totalMemoryShown","setTotalMemoryShown","_useState14","gpuJsonDataForTable","setGPUJSONDataForTable","_useState16","cpuJsonDataForTable","setCPUJSONDataForTable","_useState18","breakDownMemoryJson","setBreakDownMemoryJson","_useState20","errorMessage","_useState22","setFileNameUpload","_React$useState2","React","modalIsOpen","setIsOpen","_useState24","responseCache","setResponseCache","_useState26","responseCacheKeys","setResponseCacheKeys","_useState28","suggestions","setSuggestions","_useState30","selectedIdx","setSelectedIdx","_useState32","tokenPerSecond","setTokenPerSecond","_useState34","numGPU","setNumGPU","_useState36","numGPUINeed","setNumGPUINeed","_useState38","setMemReqHardwareName","_useState40","compReqHardwareName","setCompReqHardwareName","_useState42","compReqHardwareNameBefore","setCompReqHardwareNameBefore","_useState44","_useState46","computedTokenPerSecond","setComputedTokenPerSecond","_useState48","jsonData","setJsonData","_useState50","jsonDataCompute","setJsonDataCompute","_useState52","showSuggestions","setShowSuggestions","_useState54","showDDR","setShowDDR","_useState56","showTable","setShowTable","_useState58","showTableGPU","setShowTableGPU","_useState60","showTableCPU","setShowTableCPU","_useState62","showTableCompute","setShowTableCompute","_useState64","showTableComputeDisclaimer","setShowTableComputeDisclaimer","_useState66","showTableComputeSmallInfo","setShowTableComputeSmallInfo","_useState68","faqOpen","setFaqOpen","closeModal","_useState70","displayedText","setDisplayedText","_useState72","isVisible","setIsVisible","intervalIdRef","wordIndexRef","timeoutIdRef","clearInterval","_useState74","dropdownGPU","dropdownCPU","dropdownDDR","isGPUorCPU","setSelections","handleChangeSelection","_e$target","_objectSpread","cpuSpecs","cpuJSONData","setDDROptions","_useState76","convertByteToGB","sizeInByte","convertByteToMB","token_per_second_logic_CPU","cpuDataOnlyNum","speed","speed_ddr4","bus","cpu_compute","cpu_bandwidth","memory","useThiSpeed","Dual","Quad","Hexa","Octa","getCPUSpeedFromSpecs","memoryTransfer","totalLen","parseInt","theoryTimePrompt","theoryTimePrompt_in_ms","finalPromptTime","_k_values","getFloatRatio_F16_CPU","timeIfMemory_in_ms","totalFlopsToken","timeIfFlops_in_ms","finalTimeToConsider","memoryOrCompute","token_per_s","round","jsonComputeReturnData","toFixed","sanityChecks","check1","checkCombinationInferenceTok","check2","_asyncToGenerator","_regeneratorRuntime","_callee4","response","_context4","fetch","json","fetchData","filtered","startsWith","_jsxs","alt","TextInput","prevIdx","max","label","onlyNumGPUJsonData","gpuDataOnlyNum","gpuJSONData","Name","bandwidth","compute","onlyNumCPUJsonData","Cores","Boolean","class","_callee3","out","numGPUsINeed","_context3","gpu_compute","bnb_cost","extraGradChoice","token_per_second_logic_Train","gpu_bandwidth","extraFactor","token_per_second_logic_GPU","_callee2","_context2","token_per_second","words","fullText","setInterval","prevText","_Fragment","colSpan","entries","_ref2","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","rel","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","getElementById","App","reportWebVitals"],"sourceRoot":""}
\ No newline at end of file