Skip to content

Instantly share code, notes, and snippets.

@dlwh
dlwh / coordinator.log
Created March 4, 2024 06:07
tpu coordination service crash
(maybe coordinator?)
2024-03-04 05:14:56.199355: E external/tsl/tsl/distributed_runtime/coordination/coordination_service.cc:584] /job:jax_worker/replica:0/task:11 unexpectedly tried to connect with a different incarnation. It has likely restarted.
2024-03-04 05:14:56.199447: E external/tsl/tsl/distributed_runtime/coordination/coordination_service.cc:992] /job:jax_worker/replica:0/task:11 has been set to ERROR in coordination service: ABORTED: /job:jax_worker/replica:0/task:11 unexpectedly tried to connect with a different incarnation. It has likely restarted. [type.googleapis.com/tensorflow.CoordinationServiceError='\"\x0e\n\njax_worker\x10\x0b']
2024-03-04 05:14:56.199460: E external/tsl/tsl/distributed_runtime/coordination/coordination_service.cc:828] Stopping coordination service as there is no service-to-client connection, but we encountered an error: ABORTED: /job:jax_worker/replica:0/task:11 unexpectedly tried to connect with a different incarnation. It has likely restarted. [type.googleapis.com/tenso
@dlwh
dlwh / run_clm.py
Created August 12, 2022 18:11
bad eval output
from itertools import chain
from typing import Optional
import numpy as np
import datasets
import torch
import transformers
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set(/Users/dlwh/src/breeze/math/src/main/scala/breeze/linalg/operators/DenseMatrixOps.scala)
[debug] Invalidated products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated classes: Set(breeze.linalg.operators.DenseMatrixMultOps, breeze.linalg.operators.LowPriorityDenseMatrix1.SetDMVOp, breeze.linalg.operators.DenseMatrixFloatMultiplyStuff, breeze.linalg.operators.LowPriorityDenseMatrix.SetMSOp, breeze.linalg.operators.DenseMatrix_OrderingOps, breeze.linalg.operators.DenseMatrixFloatMultiplyStuff.implOpSolveMatrixBy_DMF_DVF_eq_DVF, breeze.linalg.operators.LowPriorityDenseMatrix.SetDMDVOp, breeze.linalg.operators.DenseMatrixFloatMultiplyStuff.implOpMulMatrix_DMF_DVF_eq_DVF, breeze.linalg.operators.DenseMatrixOps, breeze.linalg.operators.DenseMatrixMultiplyStuff.implOpMulMatrix_DMD_DMD_eq_DMD, breeze.linalg.operators.Dense
@expand
@expand.exclude(Complex, OpMod)
@expand.exclude(BigInt, OpPow)
@expand.valify
implicit def dv_dv_Op[@expand.args(Int, Double, Float, Long, BigInt, Complex) T,
@expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]
(implicit @expand.sequence[Op]({_ + _}, {_ - _}, {_ * _}, {_ / _}, {(a,b) => b}, {_ % _}, {_ pow _})
op: BinaryOp[T, T, Op, T]):BinaryOp[DenseVector[T], DenseVector[T], Op, DenseVector[T]] = {
new BinaryOp[DenseVector[T], DenseVector[T], Op, DenseVector[T]] {
def apply(a: DenseVector[T], b: DenseVector[T]): DenseVector[T] = {
@dlwh
dlwh / hs_err_pid*.log
Created September 19, 2013 17:33
qr crasher error log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f387a5541d8, pid=23871, tid=139880111486720
#
# JRE version: 7.0_05-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.1-b03 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x5741d8] jni_GetPrimitiveArrayCritical+0xc8
#
class DiagMatrix[Vec, S](val diagonalVector: Vec)(implicit evidence: Vec <:< Vector[S]) extends Matrix [S]

(The evidence implicit is because you can't write class DiagMatrix[Vec <: Vector[S], S] and expect it to work. Why? because it's apparently too hard to implement.) You would probably want type aliases like

type DenseDiagMatrix[S] = DiagMatrix[DenseVector[S], S]
@dlwh
dlwh / gist:3830758
Created October 4, 2012 00:23
enable gen-idea
mkdir -p ~/.sbt/plugins/ && cat "
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")
" >> ~/.sbt/plugins/build.sbt
mkdir ~/bin/
echo 'java -Xms512M -Xmx1G -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M -jar `dirname $0`/sbt-launch.jar "$@"' > ~/bin/sbt
@dlwh
dlwh / foo.scala
Created September 9, 2012 06:48
Selecting enabling for operators in Breeze... Enable
trait Enable[T] {
def get: T
}
trait EnableLowPriority {
implicit val eager = new Enable[Eager]{def get = new Eager}
}
object Enable extends EnableLowPriority {
object Lazy {
@dlwh
dlwh / demo.scala
Created September 2, 2012 22:18
plot option
val f = Figure()
val plot = f.plot(0)
// Option A
plot.hold = true
plot.scatter(...)
plot.scatter(...)
f.visible = true
plot.hold = false
@dlwh
dlwh / t5632.scala
Created March 30, 2012 23:17
5632 patch
--- a/src/library/scala/collection/mutable/HashTable.scala
+++ b/src/library/scala/collection/mutable/HashTable.scala
@@ -366,7 +366,7 @@ private[collection] object HashTable {
private[collection] final def newThreshold(_loadFactor: Int, size: Int) = ((size.toLong * _loadFactor) / loadFactorDenum).toInt
- private[collection] final def sizeForThreshold(_loadFactor: Int, thr: Int) = thr * loadFactorDenum / _loadFactor
+ private[collection] final def sizeForThreshold(_loadFactor: Int, thr: Int) = ((thr.toLong * loadFactorDenum) / _loadFactor).toInt
private[collection] final def capacity(expectedSize: Int) = if (expectedSize == 0) 1 else powerOfTwo(expectedSize)