You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
🎯
Focusing
Chunhua Liao
chunhualiao
🎯
Focusing
Dr. Chunhua "Leo" Liao is a senior computer scientist at the Center for Applied Scientific Computing (CASC) at Lawrence Livermore National Laboratory.
Intelligence = collect info + build models + predict outcomes of different choices + decide on optimal choice + execute the choice
The key is really to find/build a model for important things (self, others, and environment), and to quickly make good decision for actions, based on predicted outcomes of the model, and finally act on the choices.
Dictionary definition
noun: intelligence
the ability to acquire and apply knowledge and skills.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contemplating Quantitative Measures of Independence on the Eve of American Independence Day
Contemplating Quantitative Measures of Independence on the Eve of American Independence Day
The original draft was written on July 22, 2022. It has been polished by using GPT-4 this year.
This year's American Independence Day holiday prompted me to reflect on the meaning of independence and consider if there are any quantitative measures to assess it. After pondering the topic intermittently for several days, I'm finally taking the time to jot down some of my thoughts. Examining potential indicators of independence proves valuable, as it allows us to evaluate the level of independence for ourselves and those around us. Furthermore, we can analyze and enhance our independence through various methods. Like many issues globally, the independence of a country's people is not a binary (0 vs. 1) matter but rather a multi-dimensional continuum. All nations can make ongoing improvements across various dimensions.
Historically, one of the main factors that drove American colonists to pursue independence was the
A lesson using torchrun, multiple GPUs, and Python input() together
I was playing CodeLama using 2 or 4 GPUs for 7B and 30 B models, respectively.
I changed the official example instruct python code to accept user instructions using input()
inside a while loop. So I can keep giving instructions and getting results from the models.
But whenever I run the code using 2 or 4 GPUs, it just hangs after I type in an instruction.
The same code works fine if I only use 1 single GPU.
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
The Monty Hall Problem (Where is the goat) is fascinating: You are presented with three doors. Behind one door is a car, and behind the other two doors are goats. You choose one of the three doors (hoping it has a car behind it you can win it), but it remains closed for now.
I have asked gpt-4 to create a python problem to simulate the choices and compare their winning rates.
import random
# input parameter: switch or not: true or false
def play_game(switch_doors):
doors = [0, 0, 1] # Two goats (0) and one car (1)
random.shuffle(doors) # The prizes behind the doors are randomly shuffled
Initial source code understanding of ggml (llama.cpp)
I have taken quite some machine learning courses and have done a few projects already. I think I know the math formula involved in transformers and GPT models. However, I always wondered how they work in reality. The best way for me is to read and understand source codes implementing these models.
I am a C/C++ programmer mostly. I am more comfortable to read C/C++ programs. So, recently I started to read, run, and debug ggml's gpt-2 inference example since ggml is entirely written in C and can run many transformer models on a laptop: https://github.com/ggerganov/ggml/tree/master/examples/gpt-2 . The famous llama.cpp is closely connected to this library. My experiment environment is a MacBook Pro laptop+ Visual Studio Code + cmake+ CodeLLDB (gdb does not work with my M2 chip), and GPT-2 117 M model.
Here is what I have learned so far: