와 좋은 질문이네요. 덕분에 저도 원론적인 부분에서 다시 이해를 다잡는 좋은 기회가 되었습니다.
- 기본적으로 Julia의 Argument Passing 은 "pass-by-sharing"입니다. 이 점을 염두에 두셔야 합니다.
그럼 BenchmarkTools.jl
의 @btime
과 InteractiveUtils
의 @code_lowered
를 이용해서 각자의 코드가 내부적으로 어떻게 동작하는 지 알아봅시다.
- test1
FROM centos:centos7.8.2003 | |
# Install required packages | |
RUN yum groupinstall -y 'Development Tools' | |
RUN yum install -y gcc \ | |
make \ | |
patch \ | |
zlib-devel \ | |
bzip2 \ | |
bzip2-devel \ |
import pandas as pd | |
from datasets import load_dataset_builder, load_dataset, Dataset | |
def main(dataset_name1 = 'kyujinpy/OpenOrca-KO', dataset_name2 = 'Open-Orca/OpenOrca', split='train'): | |
# Load the dataset builder | |
builder1 = load_dataset_builder(dataset_name1) | |
builder2 = load_dataset_builder(dataset_name2) | |
# kyujinpy/OpenOrca-KO | |
# id, input, instruction, output |
와 좋은 질문이네요. 덕분에 저도 원론적인 부분에서 다시 이해를 다잡는 좋은 기회가 되었습니다.
그럼 BenchmarkTools.jl
의 @btime
과 InteractiveUtils
의 @code_lowered
를 이용해서 각자의 코드가 내부적으로 어떻게 동작하는 지 알아봅시다.
I hereby claim:
To claim this, I am signing this object:
#include <stdio.h> | |
#include <complex.h> | |
/* | |
Compile option : icc -std=c99 main.c -o main | |
*/ | |
int main() { | |
double complex a; | |
a = 1.0 + I * 2.0; |
using DataFrames | |
s = DataFrame([[true], [true], [false], [false], [false], [false], [false], [false], [false]], | |
[:MBF, :SBF, :VOX1, :HCM1, :YHP1, :SFF, :ACE2, :SWI5, :CLN3]) | |
for step in 1:30 | |
last = s[end, :] | |
new = proceed(last) | |
push!(s, new) | |
end |
#= /home/appleparan/src/DebugFlux/test_curnn.jl:12 =# Zygote.@code_adjoint(gradient((m->begin | |
#= /home/appleparan/src/DebugFlux/test_curnn.jl:12 =# | |
sum(m(x)) | |
end), m)) = Zygote.Adjoint(1: (%4, %5 :: Zygote.Context, %1, %2, %3) | |
%6 = (ZygoteRules._pullback)(%5, tuple, %2) | |
%7 = (getindex)(%6, 1) | |
%8 = (getindex)(%6, 2) %9 = (ZygoteRules._pullback)(%5, Core._apply, ZygoteRules.pullback, %7, %3) | |
%10 = (getindex)(%9, 1) %11 = (getindex)(%9, 2) | |
%12 = (ZygoteRules._pullback)(%5, Base.indexed_iterate, %10, 1) | |
# This file is machine-generated - editing it directly is not advised | |
[[AbstractFFTs]] | |
deps = ["LinearAlgebra"] | |
git-tree-sha1 = "380e36c66edfa099cd90116b24c1ce8cafccac40" | |
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" | |
version = "0.4.1" | |
[[AbstractTrees]] | |
deps = ["Markdown", "Test"] |
┌ Debug: Initializing CUDA after call to cuMemAlloc | |
└ @ CUDAnative ~/.julia/packages/CUDAnative/wU0tS/src/init.jl:32 | |
┌ Debug: (Re)compiling function | |
│ job = CUDAnative.CompilerJob(getfield(GPUArrays, Symbol("##23#24"))(), Tuple{CuArrays.CuKernelState,CuDeviceArray{Float32,1,CUDAnative.AS.Global},Base.Broadcast.Broadcasted{Nothing,Tuple{Base.OneTo{Int64}},typeof(CUDAnative.abs),Tuple{Base.Broadcast.Extruded{CuDeviceArray{Float32,1,CUDAnative.AS.Global},Tuple{Bool},Tuple{Int64}}}}}, v"6.1.0", true, nothing, nothing, nothing, nothing) | |
└ @ CUDAnative ~/.julia/packages/CUDAnative/wU0tS/src/compiler/driver.jl:36 | |
┌ Debug: Compiled getfield(GPUArrays, Symbol("##23#24"))() to PTX 6.1.0 for SM 6.1.0 using 11 registers. | |
│ Memory usage: 0 bytes local, 0 bytes shared, 256 bytes constant | |
└ @ CUDAnative ~/.julia/packages/CUDAnative/wU0tS/src/execution.jl:380 | |
┌ Debug: (Re)compiling function | |
│ job = CUDAnative.CompilerJob(getfield(GPUArrays, Symbol("##23#24"))(), Tuple{CuArrays.CuKernelState,CuDeviceArray{Float32,1,CUDAna |