“A partner’s distributive share of any item or class of items of income, gain, loss, deduction, or credit of the partnership shall be determined by the partnership agreement, unless otherwise provided by section 704 and paragraphs (b) through (e) of this section.”
26 C.F.R. § 1.704-1(a) https://www.ecfr.gov/current/title-26/part-1/section-1.704-1#p-1.704-1(a).
A partnership agreement of a professional-services firm, especially an accounting or law firm, often includes allocations with formulas designed so an allocation regarding the firm’s pension expense approximates the expense attributable to each individual partner.
For pension expense attributable to people other than partners and their beneficiaries, an allocation might be general regarding a whole firm or a whole department of a firm, or might be particular regarding those associates and other employees accounted for in the partner’s cost structure.