I just got a new HP desktop (AMD Ryzen 7 8700G) and was trying to get marginals predictions for a complex interaction terms for a mixed effects multinomial logit model. (I have 32 GB of RAM but I don't think that is a constraint here) My new machine is running StataNow/SE 19.5 for Windows (11) (64-bit x86-64) Revision 5-21-25.
The commands are:
. meologit Y period##i.group#i.party male bachelor married o65 b3.hhi_infl24_r [iw=rake_comb] || survey:, vce(robust)
then
.margins i.period#i.group#i.party3, expression(predict (outcome (4)) + predict(outcome (5))) vce(unconditional) saving(me_margins_period_prox_party)
NB (if it matters): The data is about 8000 survey responses over 9 different surveys grouped into 4 periods. Y is a 5-item agree/disagree scale; the interaction terms are unique valueses of group (=3), party (=3), and period (=4). Male, bachelor (degree), and married are all 0/1 and b3.hhi... is income in 6 categories. The weights are probability weights with a mean of ~1 in each survey.
BENCHMARK: My benchmark is a basic Macbook Air laptop with an Apple M2 (2022 vintage) chip (8 GB RAM) running StataNow 18.5 for Mac Apple Silicon Revision 2-26-25 (I'm running Sequoia 15.5)
Both machines estimate the basic parameters and errors qucikly... almost certainly in less than 10 seconds, and output identical estimates. Margins results are also identical... EXCEPT
The Macbook air with an M2 completed the task in a little under 2 hours (~1 hr 52 min). The desktop took almost 5 hours (~4 hours 50 minutes)
I realize that interactions and asking for unconditional errors are requiring extra time... but I think the AMD Ryzen 7 should be killing the M2.
So ... I ran this again on a simpler version of the above model. (I cut the number of surveys from 9 to 6, and the number of periods from 4 to 3... lowering to about 5000) Same model structure in the first command, but I asked margins to provide the pairwise comparison differences , that is. .
margins i.tperiod#i.proximity#i.party3, expression(predict (outcome (4)) + predict(outcome (5))) vce(unconditional) pwcompare saving(xxx)
This went much faster.... but the performance difference was similarly bad: Stata 18.5 on the M2 did it in just under 30 minutes; Stata 19.5 on the AMD chip took a little more than twice as long: a little over an hour.
Any thoughts on what is going on here? Is this really AMD, not Stata?
I realize that there may be some ways to chunk this, but I seriously did not think I was asking this new chip and newer version of Stata for an all day exercise.
I know I can get MP, but SE is all my university provides. And I'm not even sure what difference it would make here to spend 40% more a year for MP.
The LLMs instinctively(??) blame Stata... Claude4, for example, thinks the AMD chip should be crushing the M2.
Thanks for any guidance.
Lyle
PS If it matters I did set up Stata with the following commands (on both machines) to better insure this was a like with like comparison.
set mem 16g (though the mac only has 8)
clear matrix
clear mata
set maxvar 32000
set segmentsize 32m
set checksum off
The commands are:
. meologit Y period##i.group#i.party male bachelor married o65 b3.hhi_infl24_r [iw=rake_comb] || survey:, vce(robust)
then
.margins i.period#i.group#i.party3, expression(predict (outcome (4)) + predict(outcome (5))) vce(unconditional) saving(me_margins_period_prox_party)
NB (if it matters): The data is about 8000 survey responses over 9 different surveys grouped into 4 periods. Y is a 5-item agree/disagree scale; the interaction terms are unique valueses of group (=3), party (=3), and period (=4). Male, bachelor (degree), and married are all 0/1 and b3.hhi... is income in 6 categories. The weights are probability weights with a mean of ~1 in each survey.
BENCHMARK: My benchmark is a basic Macbook Air laptop with an Apple M2 (2022 vintage) chip (8 GB RAM) running StataNow 18.5 for Mac Apple Silicon Revision 2-26-25 (I'm running Sequoia 15.5)
Both machines estimate the basic parameters and errors qucikly... almost certainly in less than 10 seconds, and output identical estimates. Margins results are also identical... EXCEPT
The Macbook air with an M2 completed the task in a little under 2 hours (~1 hr 52 min). The desktop took almost 5 hours (~4 hours 50 minutes)
I realize that interactions and asking for unconditional errors are requiring extra time... but I think the AMD Ryzen 7 should be killing the M2.
So ... I ran this again on a simpler version of the above model. (I cut the number of surveys from 9 to 6, and the number of periods from 4 to 3... lowering to about 5000) Same model structure in the first command, but I asked margins to provide the pairwise comparison differences , that is. .
margins i.tperiod#i.proximity#i.party3, expression(predict (outcome (4)) + predict(outcome (5))) vce(unconditional) pwcompare saving(xxx)
This went much faster.... but the performance difference was similarly bad: Stata 18.5 on the M2 did it in just under 30 minutes; Stata 19.5 on the AMD chip took a little more than twice as long: a little over an hour.
Any thoughts on what is going on here? Is this really AMD, not Stata?
I realize that there may be some ways to chunk this, but I seriously did not think I was asking this new chip and newer version of Stata for an all day exercise.
I know I can get MP, but SE is all my university provides. And I'm not even sure what difference it would make here to spend 40% more a year for MP.
The LLMs instinctively(??) blame Stata... Claude4, for example, thinks the AMD chip should be crushing the M2.
Thanks for any guidance.
Lyle
PS If it matters I did set up Stata with the following commands (on both machines) to better insure this was a like with like comparison.
set mem 16g (though the mac only has 8)
clear matrix
clear mata
set maxvar 32000
set segmentsize 32m
set checksum off
Comment